f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_s...
authorYangtao Li <frank.li@vivo.com>
Fri, 2 Dec 2022 04:58:41 +0000 (12:58 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 12 Dec 2022 22:59:38 +0000 (14:59 -0800)
commit25547439f1dcc3def6062bd3e69165cd806a594e
tree20e91d22d362ec64c56f64d4fb28770634cfdf50
parent15e38ee44d50cad264da80ef75626b9224ddc4a3
f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

No need to call f2fs_issue_discard_timeout() in f2fs_put_super,
when no discard command requires issue. Since the caller of
f2fs_issue_discard_timeout() usually judges the number of discard
commands before using it. Let's move this logic to
f2fs_issue_discard_timeout().

By the way, use f2fs_realtime_discard_enable to simplify the code.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c
fs/f2fs/super.c