diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-04-16 12:16:56 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-04-17 18:17:00 +0200 |
commit | 8b83ac81f4283ae3bd05c9a7e15dca721014dd03 (patch) | |
tree | 1ce1a104615ba45fdb9df0a828f4b03d8b4182e4 /fs/f2fs/gc.c | |
parent | f2fs: Fix the accounting of dcc->undiscard_blks (diff) | |
download | linux-8b83ac81f4283ae3bd05c9a7e15dca721014dd03.tar.xz linux-8b83ac81f4283ae3bd05c9a7e15dca721014dd03.zip |
f2fs: support read iostat
Adds to support accounting read IOs from userspace/kernel.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 26248c8936db..28a8c79c8bdc 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -737,6 +737,9 @@ got_it: goto put_encrypted_page; f2fs_put_page(fio.encrypted_page, 0); f2fs_put_page(page, 1); + + f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); + return 0; put_encrypted_page: f2fs_put_page(fio.encrypted_page, 1); @@ -840,6 +843,9 @@ static int move_data_block(struct inode *inode, block_t bidx, f2fs_put_page(mpage, 1); goto up_out; } + + f2fs_update_iostat(fio.sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); + lock_page(mpage); if (unlikely(mpage->mapping != META_MAPPING(fio.sbi) || !PageUptodate(mpage))) { |