lkml.org 
[lkml]   [2011]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v2] NFS: account direct-io into task io accounting
    From
    Date
    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>
    ---
    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 9943a75..bd2cb5d 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>
    @@ -938,6 +939,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;
    @@ -999,6 +1002,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)


    \
     
     \ /
      Last update: 2011-02-21 22:37    [W:5.346 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site