diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-04-16 18:16:56 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-04-17 09:17:00 -0700 |
commit | 8b83ac81f4283ae3bd05c9a7e15dca721014dd03 (patch) | |
tree | 1ce1a104615ba45fdb9df0a828f4b03d8b4182e4 /fs/f2fs/data.c | |
parent | df423399757531c20d495bf6b8b83a8dcca3565c (diff) | |
download | lwn-8b83ac81f4283ae3bd05c9a7e15dca721014dd03.tar.gz lwn-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/data.c')
-rw-r--r-- | fs/f2fs/data.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index accd28728642..199877cb57fe 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1033,6 +1033,7 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page, } ClearPageError(page); inc_page_count(sbi, F2FS_RD_DATA); + f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); __submit_bio(sbi, bio, DATA); return 0; } @@ -2038,6 +2039,7 @@ submit_and_realloc: goto submit_and_realloc; inc_page_count(F2FS_I_SB(inode), F2FS_RD_DATA); + f2fs_update_iostat(F2FS_I_SB(inode), FS_DATA_READ_IO, F2FS_BLKSIZE); ClearPageError(page); *last_block_in_bio = block_nr; goto out; @@ -2173,6 +2175,7 @@ submit_and_realloc: goto submit_and_realloc; inc_page_count(sbi, F2FS_RD_DATA); + f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); ClearPageError(page); *last_block_in_bio = blkaddr; } @@ -3526,6 +3529,9 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) } else if (err < 0) { f2fs_write_failed(mapping, offset + count); } + } else { + if (err > 0) + f2fs_update_iostat(sbi, APP_DIRECT_READ_IO, err); } out: |