From 7b2fd9d51259f6cf350791434e640ac3519acc6c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 May 2016 16:01:16 +0200 Subject: core: remove duplicate code in automount_update_mount() Also, fix indentation. --- src/core/automount.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'src/core') diff --git a/src/core/automount.c b/src/core/automount.c index c871b02a94..464d6a70c0 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -477,39 +477,22 @@ int automount_update_mount(Automount *a, MountState old_state, MountState state) if (r < 0) log_unit_warning_errno(UNIT(a), r, "Failed to start expiration timer, ignoring: %m"); break; - case MOUNT_DEAD: - case MOUNT_UNMOUNTING: - case MOUNT_MOUNTING_SIGTERM: - case MOUNT_MOUNTING_SIGKILL: - case MOUNT_REMOUNTING_SIGTERM: - case MOUNT_REMOUNTING_SIGKILL: - case MOUNT_UNMOUNTING_SIGTERM: - case MOUNT_UNMOUNTING_SIGKILL: - case MOUNT_FAILED: + + case MOUNT_DEAD: + case MOUNT_UNMOUNTING: + case MOUNT_MOUNTING_SIGTERM: + case MOUNT_MOUNTING_SIGKILL: + case MOUNT_REMOUNTING_SIGTERM: + case MOUNT_REMOUNTING_SIGKILL: + case MOUNT_UNMOUNTING_SIGTERM: + case MOUNT_UNMOUNTING_SIGKILL: + case MOUNT_FAILED: if (old_state != state) automount_send_ready(a, a->tokens, -ENODEV); + (void) sd_event_source_set_enabled(a->expire_event_source, SD_EVENT_OFF); break; - default: - break; - } - switch (state) { - case MOUNT_DEAD: - automount_send_ready(a, a->expire_tokens, 0); - break; - case MOUNT_MOUNTING: - case MOUNT_MOUNTING_DONE: - case MOUNT_MOUNTING_SIGTERM: - case MOUNT_MOUNTING_SIGKILL: - case MOUNT_REMOUNTING_SIGTERM: - case MOUNT_REMOUNTING_SIGKILL: - case MOUNT_UNMOUNTING_SIGTERM: - case MOUNT_UNMOUNTING_SIGKILL: - case MOUNT_FAILED: - if (old_state != state) - automount_send_ready(a, a->expire_tokens, -ENODEV); - break; default: break; } -- cgit v1.2.3-54-g00ecf