From patchwork Mon Feb 21 19:15:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 578261 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1LJFa6Z003321 for ; Mon, 21 Feb 2011 19:15:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783Ab1BUTPv (ORCPT ); Mon, 21 Feb 2011 14:15:51 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:49936 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770Ab1BUTPu (ORCPT ); Mon, 21 Feb 2011 14:15:50 -0500 Received: by wyb38 with SMTP id 38so1457188wyb.19 for ; Mon, 21 Feb 2011 11:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:subject:to:from:cc:date:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=j6T/nzEH3Ss6vur0NYdKDTWd0X1Usc2Fm58qkb/aGu0=; b=fKxbGHw0CTEqdICDA7se9mPpm8nbvnKvV41593utaJrqwir0if7KsLQyz6cE16PMbF B1WTrohvL8T1tr6RndURn8HcJgnwWneCA9ExxGdd0WR4oDe9asbhsjMl7ZOLl8ElLQK4 duejcXZ4syMFJBJLcC6KeE2fcPCDt1mjCQAQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:to:from:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; b=aZ/P3f914qQtyYgnlHPzkIcO7wqwVU7YIwjIrJSiwjdoMmpNJC8KtFlaYFTwcbTUey uuNtN5N3RwVuWfN/57XRzBGUNyeOVF1bnT6kIPTiWyuzmj3QhHF9rd2aYRog050GcdM9 nSUIA1Up0cOxldNLQvitqo7CkEVfWq1yrUpNY= Received: by 10.227.129.7 with SMTP id m7mr1596471wbs.184.1298315749232; Mon, 21 Feb 2011 11:15:49 -0800 (PST) Received: from localhost (koct9i.static.corbina.ru [95.31.9.146]) by mx.google.com with ESMTPS id f27sm21005wbf.7.2011.02.21.11.15.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Feb 2011 11:15:48 -0800 (PST) Subject: [PATCH] NFS: account direct-io into task io accounting To: linux-nfs@vger.kernel.org From: Konstantin Khlebnikov Cc: Trond Myklebust , linux-kernel@vger.kernel.org Date: Mon, 21 Feb 2011 22:15:46 +0300 Message-ID: <20110221191546.5920.96947.stgit@localhost6> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Feb 2011 19:15:52 +0000 (UTC) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 9943a75..bab4185 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -939,8 +940,10 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov, goto out; retval = nfs_direct_read(iocb, iov, nr_segs, pos); - if (retval > 0) + if (retval > 0) { iocb->ki_pos = pos + retval; + task_io_account_read(retval); + } out: return retval; @@ -1001,8 +1004,10 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, retval = nfs_direct_write(iocb, iov, nr_segs, pos, count); - if (retval > 0) + if (retval > 0) { iocb->ki_pos = pos + retval; + task_io_account_write(retval); + } out: return retval;