diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-01-13 03:14:04 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-01-31 10:47:45 -0800 |
commit | b1c5ef26e4e80277641afcfedffe598c3023c095 (patch) | |
tree | 670bff7fdd893a8700da92319410981fed40c800 /fs/f2fs/super.c | |
parent | c1085957dece02bda586cbffc1328f3bca09325f (diff) |
f2fs: return true if all cmd were issued or no cmd need to be issued for f2fs_issue_discard_timeout()
f2fs_issue_discard_timeout() returns whether discard cmds are dropped,
which does not match the meaning of the function. Let's change it to
return whether all discard cmd are issued.
After commit 4d67490498ac ("f2fs: Don't create discard thread when
device doesn't support realtime discard"), f2fs_issue_discard_timeout()
is alse called by f2fs_remount(). Since the comments of
f2fs_issue_discard_timeout() doesn't make much sense, let's update it.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ab8a77ffc1f4..fddff5deaed2 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1546,7 +1546,7 @@ static void f2fs_put_super(struct super_block *sb) { struct f2fs_sb_info *sbi = F2FS_SB(sb); int i; - bool dropped; + bool done; /* unregister procfs/sysfs entries in advance to avoid race case */ f2fs_unregister_sysfs(sbi); @@ -1576,9 +1576,8 @@ static void f2fs_put_super(struct super_block *sb) } /* be sure to wait for any on-going discard commands */ - dropped = f2fs_issue_discard_timeout(sbi); - - if (f2fs_realtime_discard_enable(sbi) && !sbi->discard_blks && !dropped) { + done = f2fs_issue_discard_timeout(sbi); + if (f2fs_realtime_discard_enable(sbi) && !sbi->discard_blks && done) { struct cp_control cpc = { .reason = CP_UMOUNT | CP_TRIMMED, }; |