]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/mount: trivial coding style cleanups
authorMike Yuan <me@yhndnzj.com>
Wed, 12 Feb 2025 13:56:34 +0000 (14:56 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 12 Feb 2025 14:34:53 +0000 (15:34 +0100)
src/core/mount.c
src/core/mount.h

index 9632a12ca679a4cd9a29393e900662a43a2f05d9..779c8db77cebf9ef2fbe6fd10991888f49e678d5 100644 (file)
@@ -45,9 +45,9 @@ static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
         [MOUNT_MOUNTING_DONE]      = UNIT_ACTIVATING,
         [MOUNT_MOUNTED]            = UNIT_ACTIVE,
         [MOUNT_REMOUNTING]         = UNIT_RELOADING,
-        [MOUNT_UNMOUNTING]         = UNIT_DEACTIVATING,
         [MOUNT_REMOUNTING_SIGTERM] = UNIT_RELOADING,
         [MOUNT_REMOUNTING_SIGKILL] = UNIT_RELOADING,
+        [MOUNT_UNMOUNTING]         = UNIT_DEACTIVATING,
         [MOUNT_UNMOUNTING_SIGTERM] = UNIT_DEACTIVATING,
         [MOUNT_UNMOUNTING_SIGKILL] = UNIT_DEACTIVATING,
         [MOUNT_FAILED]             = UNIT_FAILED,
@@ -1056,6 +1056,8 @@ static void mount_enter_unmounting(Mount *m) {
                     MOUNT_UNMOUNTING_SIGKILL))
                 m->n_retry_umount = 0;
 
+        mount_unwatch_control_pid(m);
+
         m->control_command_id = MOUNT_EXEC_UNMOUNT;
         m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT;
 
@@ -1065,8 +1067,6 @@ static void mount_enter_unmounting(Mount *m) {
                 goto fail;
         }
 
-        mount_unwatch_control_pid(m);
-
         r = mount_spawn(m, m->control_command, mount_exec_flags(MOUNT_UNMOUNTING), &m->control_pid);
         if (r < 0) {
                 log_unit_warning_errno(UNIT(m), r, "Failed to spawn 'umount' task: %m");
@@ -1074,7 +1074,6 @@ static void mount_enter_unmounting(Mount *m) {
         }
 
         mount_set_state(m, MOUNT_UNMOUNTING);
-
         return;
 
 fail:
index 28cc7785d88e127fd1aaf34cf5af473a55eb74a3..a8ae25e638e61d6d4b819be4885cc70affc49167 100644 (file)
@@ -81,7 +81,7 @@ struct Mount {
 
         MountState state, deserialized_state;
 
-        ExecCommandcontrol_command;
+        ExecCommand *control_command;
         MountExecCommand control_command_id;
         PidRef control_pid;