diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-11-19 15:29:26 -0500 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-12-03 16:09:02 -0600 |
commit | 02516d3ff949271de661666353aa87ee06d74cce (patch) | |
tree | 9d4d720ffd28be5c04ff23c7682aa1dbbac6f6f0 /image_manager.cpp | |
parent | 3a19e62a59f317e5fae70054f6d8dafe985d8105 (diff) | |
download | phosphor-bmc-code-mgmt-02516d3ff949271de661666353aa87ee06d74cce.tar.gz phosphor-bmc-code-mgmt-02516d3ff949271de661666353aa87ee06d74cce.zip |
sync/watch: reduce memory usage
Currently we get a different inotify handle for every file in the
synclist, and register all of them with sd_event. A single fd will
work and saves memory in libsystemd and the kernel, so do that instead.
This in turn allows the fileMap structure to be simplified down to a
basic map of watch descriptor / filename pairs.
Remove redundant calls to both close and inotify_rm_watch - let the
kernel do the work for us. From the inotify man page:
When all file descriptors referring to an inotify instance have been
closed (using close(2)), the underlying object and its resources are
freed for reuse by the kernel; all associated watches are auto‐
matically freed.
Change-Id: Ia63cb667cdf41c171276a0351d95347a54578f2f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'image_manager.cpp')
0 files changed, 0 insertions, 0 deletions