core: drop 'wants' parameter from unit_add_node_dependency()

Since Wants dependency is no more automagically added to swap and mount units,
this parameter is no more used hence this patch drops it.
This commit is contained in:
Franck Bui 2019-10-28 18:50:43 +01:00
parent 9b88bb5023
commit d336ba9fa6
5 changed files with 8 additions and 18 deletions

View file

@ -361,7 +361,7 @@ static int mount_add_device_dependencies(Mount *m) {
/* We always use 'what' from /proc/self/mountinfo if mounted */
mask = m->from_proc_self_mountinfo ? UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT : UNIT_DEPENDENCY_FILE;
r = unit_add_node_dependency(UNIT(m), p->what, false, dep, mask);
r = unit_add_node_dependency(UNIT(m), p->what, dep, mask);
if (r < 0)
return r;

View file

@ -294,7 +294,7 @@ static int socket_add_device_dependencies(Socket *s) {
return 0;
t = strjoina("/sys/subsystem/net/devices/", s->bind_to_device);
return unit_add_node_dependency(UNIT(s), t, false, UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE);
return unit_add_node_dependency(UNIT(s), t, UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE);
}
static int socket_add_default_dependencies(Socket *s) {

View file

@ -197,7 +197,7 @@ static int swap_add_device_dependencies(Swap *s) {
return 0;
if (is_device_path(s->what))
return unit_add_node_dependency(UNIT(s), s->what, false, UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE);
return unit_add_node_dependency(UNIT(s), s->what, UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE);
/* File based swap devices need to be ordered after systemd-remount-fs.service,
* since they might need a writable file system. */

View file

@ -3832,7 +3832,7 @@ int unit_deserialize_skip(FILE *f) {
}
}
int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependency dep, UnitDependencyMask mask) {
int unit_add_node_dependency(Unit *u, const char *what, UnitDependency dep, UnitDependencyMask mask) {
Unit *device;
_cleanup_free_ char *e = NULL;
int r;
@ -3862,19 +3862,9 @@ int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependen
if (dep == UNIT_REQUIRES && device_shall_be_bound_by(device, u))
dep = UNIT_BINDS_TO;
r = unit_add_two_dependencies(u, UNIT_AFTER,
MANAGER_IS_SYSTEM(u->manager) ? dep : UNIT_WANTS,
device, true, mask);
if (r < 0)
return r;
if (wants) {
r = unit_add_dependency(device, UNIT_WANTS, u, false, mask);
if (r < 0)
return r;
}
return 0;
return unit_add_two_dependencies(u, UNIT_AFTER,
MANAGER_IS_SYSTEM(u->manager) ? dep : UNIT_WANTS,
device, true, mask);
}
int unit_coldplug(Unit *u) {

View file

@ -733,7 +733,7 @@ int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs);
int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
int unit_deserialize_skip(FILE *f);
int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependency d, UnitDependencyMask mask);
int unit_add_node_dependency(Unit *u, const char *what, UnitDependency d, UnitDependencyMask mask);
int unit_coldplug(Unit *u);
void unit_catchup(Unit *u);