diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-11 00:52:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-11 00:52:00 +0200 |
commit | fe51822e7120e89566cf76278d0b78ec7db4b43a (patch) | |
tree | d54f08b88805dee5604b3dc8d23a67edd956b466 /src/load-dropin.c | |
parent | 9014a8bd7a88aa4794b730e7fccf7838a00ad351 (diff) |
manager: introduce unit path cache to minimize disk accesses
Diffstat (limited to 'src/load-dropin.c')
-rw-r--r-- | src/load-dropin.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/load-dropin.c b/src/load-dropin.c index bdf3dd2c2e..9ba1201dbc 100644 --- a/src/load-dropin.c +++ b/src/load-dropin.c @@ -84,7 +84,11 @@ int unit_load_dropin(Unit *u) { if (asprintf(&path, "%s/%s.wants", *p, t) < 0) return -ENOMEM; - r = iterate_dir(u, path); + if (u->meta.manager->unit_path_cache && + !set_get(u->meta.manager->unit_path_cache, path)) + r = 0; + else + r = iterate_dir(u, path); free(path); if (r < 0) @@ -103,7 +107,11 @@ int unit_load_dropin(Unit *u) { if (r < 0) return -ENOMEM; - r = iterate_dir(u, path); + if (u->meta.manager->unit_path_cache && + !set_get(u->meta.manager->unit_path_cache, path)) + r = 0; + else + r = iterate_dir(u, path); free(path); if (r < 0) |