mount: set up local-fs.target/remote-fs.target deps in mount_add_default_dependencies() too

This deps are very similar to the -pre deps, hence establish them at the
same place, in particular as they should only be generated if default
deps are on.

This allows us to later on remove similar code that adds in these deps
whenever /proc/self/mountinfo changes.
This commit is contained in:
Lennart Poettering 2018-11-28 12:35:37 +01:00
parent 32a5f8fe22
commit d54bab90e6
1 changed files with 10 additions and 3 deletions

View File

@ -423,10 +423,10 @@ static bool mount_is_extrinsic(Mount *m) {
}
static int mount_add_default_dependencies(Mount *m) {
const char *after, *before;
UnitDependencyMask mask;
int r;
MountParameters *p;
const char *after;
int r;
assert(m);
@ -468,8 +468,15 @@ static int mount_add_default_dependencies(Mount *m) {
return r;
after = SPECIAL_REMOTE_FS_PRE_TARGET;
} else
before = SPECIAL_REMOTE_FS_TARGET;
} else {
after = SPECIAL_LOCAL_FS_PRE_TARGET;
before = SPECIAL_LOCAL_FS_TARGET;
}
r = unit_add_dependency_by_name(UNIT(m), UNIT_BEFORE, before, true, mask);
if (r < 0)
return r;
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after, true, mask);
if (r < 0)