void *userdata,
sd_bus_error *error) {
+ const char *fstype = NULL;
Mount *m = userdata;
assert(bus);
assert(reply);
assert(m);
- return sd_bus_message_append(reply, "s", mount_get_fstype(m));
+ if (m->from_proc_self_mountinfo && m->parameters_proc_self_mountinfo.fstype)
+ fstype = m->parameters_proc_self_mountinfo.fstype;
+ else if (m->from_fragment && m->parameters_fragment.fstype)
+ fstype = m->parameters_fragment.fstype;
+
+ return sd_bus_message_append(reply, "s", fstype);
}
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, mount_result, MountResult);
"usrquota\0" "grpquota\0" "quota\0" "usrjquota\0" "grpjquota\0");
}
-const char *mount_get_fstype(const Mount *m) {
- const char *type = NULL;
-
- assert(m);
-
- if (m->from_proc_self_mountinfo && m->parameters_proc_self_mountinfo.fstype)
- type = m->parameters_proc_self_mountinfo.fstype;
- else if (m->from_fragment && m->parameters_fragment.fstype)
- type = m->parameters_fragment.fstype;
- else
- type = "";
-
- return type;
-}
-
static void mount_init(Unit *u) {
Mount *m = MOUNT(u);
}
static int mount_add_mount_dependencies(Mount *m) {
- const char *fstype;
MountParameters *pm;
Unit *other;
Iterator i;
}
}
- /* If this is a tmpfs mount then we have to unmount it before we try to deactivate swaps */
- fstype = mount_get_fstype(m);
- if (streq(fstype, "tmpfs")) {
- r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_SWAP_TARGET, NULL, true, UNIT_DEPENDENCY_IMPLICIT);
- if (r < 0)
- return r;
- }
-
return 0;
}
if (r < 0)
return r;
+ /* If this is a tmpfs mount then we have to unmount it before we try to deactivate swaps */
+ if (streq(p->fstype, "tmpfs")) {
+ r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_SWAP_TARGET, NULL, true, mask);
+ if (r < 0)
+ return r;
+ }
+
return 0;
}