Thread (9 messages) 9 messages, 1 author, 2011-11-28
STALE5329d
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 6/8] ext4: account the data request of write operations in buffered io

From: Zheng Liu <hidden>
Date: 2011-11-28 12:20:26
Also in: linux-fsdevel
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

From: Zheng Liu <redacted>

We call ext4_ios_write() function to account the data request of write in
buffered io.

CC: Jens Axboe <axboe@kernel.dk>
CC: Steven Whitehouse <redacted>
CC: Aditya Kali <redacted>
Signed-off-by: Wang Shaoyan <redacted>
Signed-off-by: Zheng Liu <redacted>
---
 fs/ext4/inode.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index e5e9acb..3cd862d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1905,6 +1905,8 @@ static int ext4_writepage(struct page *page,
 	struct inode *inode = page->mapping->host;
 
 	trace_ext4_writepage(page);
+	ext4_ios_write(inode->i_sb, NULL, NULL, EXT4_IOS_REGULAR_DATA,
+			ext4_blocks_per_page(inode));
 	size = i_size_read(inode);
 	if (page->index == size >> PAGE_CACHE_SHIFT)
 		len = size & ~PAGE_CACHE_MASK;
@@ -2079,6 +2081,9 @@ static int write_cache_pages_da(struct address_space *mapping,
 			logical = (sector_t) page->index <<
 				(PAGE_CACHE_SHIFT - inode->i_blkbits);
 
+			ext4_ios_write(inode->i_sb, NULL, NULL,
+					EXT4_IOS_REGULAR_DATA,
+					ext4_blocks_per_page(inode));
 			if (!page_has_buffers(page)) {
 				mpage_add_bh_to_extent(mpd, logical,
 						       PAGE_CACHE_SIZE,
@@ -3449,8 +3454,11 @@ int ext4_block_zero_page_range(handle_t *handle,
 	err = 0;
 	if (ext4_should_journal_data(inode)) {
 		err = ext4_handle_dirty_metadata(handle, inode, bh);
-	} else
+	} else {
+		ext4_ios_write(inode->i_sb, handle, bh,
+				EXT4_IOS_REGULAR_DATA, 1);
 		mark_buffer_dirty(bh);
+	}
 
 unlock:
 	unlock_page(page);
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help