linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: Zheng Liu <wenqing.lz@taobao.com>, Jens Axboe <axboe@kernel.dk>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Aditya Kali <adityakali@google.com>,
	Wang Shaoyan <wangshaoyan.pt@taobao.com>
Subject: [PATCH v4 6/8] ext4: account the data request of write operations in buffered io
Date: Tue, 24 Jan 2012 00:50:26 +0800	[thread overview]
Message-ID: <1327337428-8266-7-git-send-email-wenqing.lz@taobao.com> (raw)
In-Reply-To: <1327337428-8266-1-git-send-email-wenqing.lz@taobao.com>

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 <swhiteho@redhat.com>
CC: Aditya Kali <adityakali@google.com>
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/inode.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 176977a..cfebc6d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1910,6 +1910,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;
@@ -2084,6 +2086,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,
-- 
1.7.4.1


  parent reply	other threads:[~2012-01-23 16:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 16:50 [PATCH v4 0/8] ext4: io type accouting Zheng Liu
2012-01-23 16:50 ` [PATCH v4 1/8] ext4: add percpu counters and related functions to account io types Zheng Liu
2012-01-23 16:50 ` [PATCH v4 2/8] ext4: add wrapper functions for buffer layer Zheng Liu
2012-01-23 16:50 ` [PATCH v4 3/8] ext4: account the metadata request of read operations in buffered io Zheng Liu
2012-01-23 16:50 ` [PATCH v4 4/8] ext4: account the data " Zheng Liu
2012-01-23 16:50 ` [PATCH v4 5/8] ext4: account the metadata request of write " Zheng Liu
2012-01-23 16:50 ` Zheng Liu [this message]
2012-01-23 16:50 ` [PATCH v4 7/8] ext4: request accouting in direct io Zheng Liu
2012-01-23 16:50 ` [PATCH v4 8/8] ext4: show the result of io types accouting Zheng Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327337428-8266-7-git-send-email-wenqing.lz@taobao.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=adityakali@google.com \
    --cc=axboe@kernel.dk \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    --cc=wangshaoyan.pt@taobao.com \
    --cc=wenqing.lz@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).