summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-04-14 22:01:48 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-21 20:23:41 +0200
commitdeb0a77cf0b409141c4b116ae30becb3d878e1ad (patch)
treeeb40f2d8df1cb1a6e7e5c6fbb367b3b8bdfc1a5f /src/core/mount.c
parent297f24a902110921a0627b40372ed2332229b706 (diff)
automount: add expire support
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 8bfbbed2c0..d3a4098f1a 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -548,7 +548,7 @@ static int mount_load(Unit *u) {
return mount_verify(m);
}
-static int mount_notify_automount(Mount *m, int status) {
+static int mount_notify_automount(Mount *m, MountState old_state, MountState state) {
Unit *p;
int r;
Iterator i;
@@ -557,7 +557,7 @@ static int mount_notify_automount(Mount *m, int status) {
SET_FOREACH(p, UNIT(m)->dependencies[UNIT_TRIGGERED_BY], i)
if (p->type == UNIT_AUTOMOUNT) {
- r = automount_send_ready(AUTOMOUNT(p), status);
+ r = automount_update_mount(AUTOMOUNT(p), old_state, state);
if (r < 0)
return r;
}
@@ -588,21 +588,7 @@ static void mount_set_state(Mount *m, MountState state) {
m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
}
- if (state == MOUNT_MOUNTED ||
- state == MOUNT_REMOUNTING)
- mount_notify_automount(m, 0);
- else if (state == MOUNT_DEAD ||
- state == MOUNT_UNMOUNTING ||
- state == MOUNT_MOUNTING_SIGTERM ||
- state == MOUNT_MOUNTING_SIGKILL ||
- state == MOUNT_REMOUNTING_SIGTERM ||
- state == MOUNT_REMOUNTING_SIGKILL ||
- state == MOUNT_UNMOUNTING_SIGTERM ||
- state == MOUNT_UNMOUNTING_SIGKILL ||
- state == MOUNT_FAILED) {
- if (state != old_state)
- mount_notify_automount(m, -ENODEV);
- }
+ mount_notify_automount(m, old_state, state);
if (state != old_state)
log_unit_debug(UNIT(m)->id,