All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, Peng Tao <tao.peng@emc.com>
Subject: [PATCH 2/2] NFS: call block plug around direct read
Date: Tue, 15 May 2012 23:38:23 +0800	[thread overview]
Message-ID: <1337096303-2516-2-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1337096303-2516-1-git-send-email-bergwolf@gmail.com>

Signed-off-by: Peng Tao <tao.peng@emc.com>
---
 fs/nfs/direct.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index a485560..2cf3b45 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -866,6 +866,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
 	ssize_t retval = -EINVAL;
 	struct file *file = iocb->ki_filp;
 	struct address_space *mapping = file->f_mapping;
+	struct blk_plug plug;
 	size_t count;
 
 	count = iov_length(iov, nr_segs);
@@ -886,7 +887,9 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
 
 	task_io_account_read(count);
 
+	blk_start_plug(&plug);
 	retval = nfs_direct_read(iocb, iov, nr_segs, pos);
+	blk_finish_plug(&plug);
 	if (retval > 0)
 		iocb->ki_pos = pos + retval;
 
-- 
1.7.1.262.g5ef3d


  reply	other threads:[~2012-05-15 15:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 15:38 [PATCH 1/2] NFS: call block plug around direct write Peng Tao
2012-05-15 15:38 ` Peng Tao [this message]
2012-05-16 17:12   ` [PATCH 2/2] NFS: call block plug around direct read Myklebust, Trond
2012-05-15 16:08 ` [PATCH 1/2] NFS: call block plug around direct write Christoph Hellwig
2012-05-15 16:23   ` Boaz Harrosh
2012-05-16  0:35     ` Peng Tao
2012-05-16  7:43       ` Boaz Harrosh
2012-05-16 17:12 ` Myklebust, Trond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337096303-2516-2-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tao.peng@emc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.