[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Nov 2011 18:34:50 +0800
From: Zheng Liu <gnehzuil.liu@...il.com>
To: linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc: Zheng Liu <wenqing.lz@...bao.com>,
Wang Shaoyan <wangshaoyan.pt@...bao.com>
Subject: [PATCH v2 4/8] ext4: Count data request of read operations in buffered io
From: Zheng Liu <wenqing.lz@...bao.com>
Call ext4_ios_read*() and __ext4_io_stat() functions to count the data of
buffered io in ext4. In ext4_readpage() and ext4_readpages(), we call
__ext4_io_stat() directly because these functions don't use buffer_head.
Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@...bao.com>
---
fs/ext4/inode.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d4f9da3..5a1fca0 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2680,6 +2680,8 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
static int ext4_readpage(struct file *file, struct page *page)
{
trace_ext4_readpage(page);
+ __ext4_io_stat(READ, EXT4_IOS_REGULAR_DATA,
+ ext4_blocks_per_page(page->mapping->host));
return mpage_readpage(page, ext4_get_block);
}
@@ -2687,6 +2689,8 @@ static int
ext4_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
+ __ext4_io_stat(READ, EXT4_IOS_REGULAR_DATA,
+ nr_pages * ext4_blocks_per_page(mapping->host));
return mpage_readpages(mapping, pages, nr_pages, ext4_get_block);
}
@@ -3305,6 +3309,8 @@ int ext4_discard_partial_page_buffers_no_lock(handle_t *handle,
err = -EIO;
ll_rw_block(READ, 1, &bh);
wait_on_buffer(bh);
+ ext4_ios_read(bh, EXT4_IOS_REGULAR_DATA,
+ ext4_blocks_per_page(inode));
/* Uhhuh. Read error. Complain and punt.*/
if (!buffer_uptodate(bh))
goto next;
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists