summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2022-12-05 22:56:03 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-12-12 14:59:38 -0800
commit15e38ee44d50cad264da80ef75626b9224ddc4a3 (patch)
tree886fbbcb3b4ed72b1613090bb539cfa9cf90b824 /fs/f2fs/segment.c
parentdb8dcd25ec84120d4e57a7f17a566825cec17ae8 (diff)
f2fs: fix iostat parameter for discard
Just like other data we count uses the number of bytes as the basic unit, but discard uses the number of cmds as the statistical unit. In fact the discard command contains the number of blocks, so let's change to the number of bytes as the base unit. Fixes: b0af6d491a6b ("f2fs: add app/fs io stat") Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index dee712f7225f..f1845a032885 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1187,7 +1187,7 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
atomic_inc(&dcc->issued_discard);
- f2fs_update_iostat(sbi, NULL, FS_DISCARD, 1);
+ f2fs_update_iostat(sbi, NULL, FS_DISCARD, len * F2FS_BLKSIZE);
lstart += len;
start += len;