summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@openvz.org>2011-02-22 00:28:34 +0300
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:39:27 -0500
commit7ec10f26e1fd5fcceb9c96e508c1292a816199f7 (patch)
tree20cdd3ae42fe5ed123c71fe0ce4b5b8787198c81 /fs/nfs
parentf8628220bb395104697be9c447c1085846dfc97c (diff)
downloadop-kernel-dev-7ec10f26e1fd5fcceb9c96e508c1292a816199f7.zip
op-kernel-dev-7ec10f26e1fd5fcceb9c96e508c1292a816199f7.tar.gz
NFS: account direct-io into task io accounting
Account NFS direct-io reads and writes into Task I/O Accounting. Do it before complition to handle aio. NFS have unusual direct-io implementation, thus accounting in generic code does not work. Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/direct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index f493bdd..8eea253 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -45,6 +45,7 @@
#include <linux/pagemap.h>
#include <linux/kref.h>
#include <linux/slab.h>
+#include <linux/task_io_accounting_ops.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
@@ -937,6 +938,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
if (retval)
goto out;
+ task_io_account_read(count);
+
retval = nfs_direct_read(iocb, iov, nr_segs, pos);
if (retval > 0)
iocb->ki_pos = pos + retval;
@@ -998,6 +1001,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
if (retval)
goto out;
+ task_io_account_write(count);
+
retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
if (retval > 0)
OpenPOWER on IntegriCloud