From patchwork Thu Nov 10 10:34:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 124848 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 275641007DA for ; Thu, 10 Nov 2011 21:33:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755686Ab1KJKd4 (ORCPT ); Thu, 10 Nov 2011 05:33:56 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:65483 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755111Ab1KJKdy (ORCPT ); Thu, 10 Nov 2011 05:33:54 -0500 Received: by mail-iy0-f174.google.com with SMTP id e36so2736623iag.19 for ; Thu, 10 Nov 2011 02:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=VLpfQlKG0t8fRkmg2Mcpcu3LiHnJKBC4cC0M2j7LroA=; b=jB/X78X2MkzgSH+7NRxEWZH8H3mMWLKZYq4Savc5KfgK8ht3CYP8SoL2logHKm0Y0l iz91ccSpYJ5rti8mF4ydjIM4Dz/7irYUZ3jpVeGoEGxScD4sMNXZrFTrXpZrcVYk0kvF 5ZPJp20csAcUrDGhYSzRKB7nuzfwOVTU9ZmuY= Received: by 10.50.169.33 with SMTP id ab1mr7184197igc.0.1320921234334; Thu, 10 Nov 2011 02:33:54 -0800 (PST) Received: from localhost.localdomain ([182.92.247.2]) by mx.google.com with ESMTPS id fu10sm6077720igc.6.2011.11.10.02.33.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Nov 2011 02:33:53 -0800 (PST) From: Zheng Liu To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Zheng Liu , Wang Shaoyan Subject: [PATCH v2 4/8] ext4: Count data request of read operations in buffered io Date: Thu, 10 Nov 2011 18:34:50 +0800 Message-Id: <1320921294-30321-5-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1320921294-30321-1-git-send-email-wenqing.lz@taobao.com> References: <1320921294-30321-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zheng Liu 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 Signed-off-by: Wang Shaoyan --- 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;