]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
f2fs: clean up destroy_discard_cmd_control
authorChao Yu <yuchao0@huawei.com>
Mon, 27 Mar 2017 10:14:04 +0000 (18:14 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Apr 2017 18:05:04 +0000 (11:05 -0700)
Remove unneeded parameter and simply change flow in
destroy_discard_cmd_control.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index af80d8954a01b7baf41ba2c009dd78e7d9baca17..d5413afdd3dab38fa298a98d0fbea760b9e2a347 100644 (file)
@@ -1167,20 +1167,22 @@ init_thread:
        return err;
 }
 
-static void destroy_discard_cmd_control(struct f2fs_sb_info *sbi, bool free)
+static void destroy_discard_cmd_control(struct f2fs_sb_info *sbi)
 {
        struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
 
-       if (dcc && dcc->f2fs_issue_discard) {
+       if (!dcc)
+               return;
+
+       if (dcc->f2fs_issue_discard) {
                struct task_struct *discard_thread = dcc->f2fs_issue_discard;
 
                dcc->f2fs_issue_discard = NULL;
                kthread_stop(discard_thread);
        }
-       if (free) {
-               kfree(dcc);
-               SM_I(sbi)->dcc_info = NULL;
-       }
+
+       kfree(dcc);
+       SM_I(sbi)->dcc_info = NULL;
 }
 
 static bool __mark_sit_entry_dirty(struct f2fs_sb_info *sbi, unsigned int segno)
@@ -3073,7 +3075,7 @@ void destroy_segment_manager(struct f2fs_sb_info *sbi)
        if (!sm_info)
                return;
        destroy_flush_cmd_control(sbi, true);
-       destroy_discard_cmd_control(sbi, true);
+       destroy_discard_cmd_control(sbi);
        destroy_dirty_segmap(sbi);
        destroy_curseg(sbi);
        destroy_free_segmap(sbi);