diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-03-27 18:14:04 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-05 11:05:04 -0700 |
commit | f099405fc8d6c837487dcd6ab288073a44e6a91f (patch) | |
tree | 51d09703e0e69f10da919f7ca4499d326b2b46f0 | |
parent | 5f32366a29b48bf6878ede83149819e38999c2fd (diff) | |
download | linux-stable-f099405fc8d6c837487dcd6ab288073a44e6a91f.tar.gz linux-stable-f099405fc8d6c837487dcd6ab288073a44e6a91f.tar.bz2 linux-stable-f099405fc8d6c837487dcd6ab288073a44e6a91f.zip |
f2fs: clean up destroy_discard_cmd_control
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>
-rw-r--r-- | fs/f2fs/segment.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index af80d8954a01..d5413afdd3da 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -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); |