@@ -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>
@@ -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;