diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-03-27 18:14:04 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-05-21 18:39:46 +0200 |
| commit | d31b405e43f96091494376eb5153dc115b08495f (patch) | |
| tree | 786f23ca0eabba32a2734a1195412fc51be2733b | |
| parent | 7df8600a747a106ba29d59352a3bb58a89592baa (diff) | |
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 2a33098bd..f8665c5b7 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1305,20 +1305,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) @@ -3211,7 +3213,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); |
