summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-11 00:52:00 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-11 00:52:00 +0200
commitfe51822e7120e89566cf76278d0b78ec7db4b43a (patch)
treed54f08b88805dee5604b3dc8d23a67edd956b466 /src/load-fragment.c
parent9014a8bd7a88aa4794b730e7fccf7838a00ad351 (diff)
manager: introduce unit path cache to minimize disk accesses
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 6a71d422f4..394aa023f3 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1690,7 +1690,13 @@ static int load_from_path(Unit *u, const char *path) {
goto finish;
}
- if ((r = open_follow(&filename, &f, symlink_names, &id)) < 0) {
+ if (u->meta.manager->unit_path_cache &&
+ !set_get(u->meta.manager->unit_path_cache, filename))
+ r = -ENOENT;
+ else
+ r = open_follow(&filename, &f, symlink_names, &id);
+
+ if (r < 0) {
char *sn;
free(filename);