diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2011-02-21 16:28:34 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:39:27 -0500 |
commit | 7ec10f26e1fd5fcceb9c96e508c1292a816199f7 (patch) | |
tree | 20cdd3ae42fe5ed123c71fe0ce4b5b8787198c81 /fs/nfs | |
parent | f8628220bb395104697be9c447c1085846dfc97c (diff) |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index f493bdd74f78..8eea25366717 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/pagemap.h> | 45 | #include <linux/pagemap.h> |
46 | #include <linux/kref.h> | 46 | #include <linux/kref.h> |
47 | #include <linux/slab.h> | 47 | #include <linux/slab.h> |
48 | #include <linux/task_io_accounting_ops.h> | ||
48 | 49 | ||
49 | #include <linux/nfs_fs.h> | 50 | #include <linux/nfs_fs.h> |
50 | #include <linux/nfs_page.h> | 51 | #include <linux/nfs_page.h> |
@@ -937,6 +938,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov, | |||
937 | if (retval) | 938 | if (retval) |
938 | goto out; | 939 | goto out; |
939 | 940 | ||
941 | task_io_account_read(count); | ||
942 | |||
940 | retval = nfs_direct_read(iocb, iov, nr_segs, pos); | 943 | retval = nfs_direct_read(iocb, iov, nr_segs, pos); |
941 | if (retval > 0) | 944 | if (retval > 0) |
942 | iocb->ki_pos = pos + retval; | 945 | iocb->ki_pos = pos + retval; |
@@ -998,6 +1001,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
998 | if (retval) | 1001 | if (retval) |
999 | goto out; | 1002 | goto out; |
1000 | 1003 | ||
1004 | task_io_account_write(count); | ||
1005 | |||
1001 | retval = nfs_direct_write(iocb, iov, nr_segs, pos, count); | 1006 | retval = nfs_direct_write(iocb, iov, nr_segs, pos, count); |
1002 | 1007 | ||
1003 | if (retval > 0) | 1008 | if (retval > 0) |