core/mount: report accurate can_start and can_reload

This commit is contained in:
Mike Yuan
2025-02-12 15:33:11 +01:00
parent 65bc0c03b9
commit 74c0d9726c
+11
View File
@@ -1424,6 +1424,12 @@ static int mount_reload(Unit *u) {
return 1;
}
static bool mount_can_reload(Unit *u) {
Mount *m = ASSERT_PTR(MOUNT(u));
return get_mount_parameters_fragment(m);
}
static int mount_serialize(Unit *u, FILE *f, FDSet *fds) {
Mount *m = ASSERT_PTR(MOUNT(u));
@@ -2361,6 +2367,9 @@ static int mount_can_start(Unit *u) {
return r;
}
if (!get_mount_parameters_fragment(m))
return -ENOENT;
return 1;
}
@@ -2475,7 +2484,9 @@ const UnitVTable mount_vtable = {
.start = mount_start,
.stop = mount_stop,
.reload = mount_reload,
.can_reload = mount_can_reload,
.clean = mount_clean,
.can_clean = mount_can_clean,