netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Grover <andy.grover@oracle.com>
To: netdev@vger.kernel.org
Cc: rds-devel@oss.oracle.com
Subject: [PATCH 07/12] RDS: use get_user_pages_fast()
Date: Thu,  9 Apr 2009 17:09:42 -0700	[thread overview]
Message-ID: <1239322187-3764-8-git-send-email-andy.grover@oracle.com> (raw)
In-Reply-To: <1239322187-3764-1-git-send-email-andy.grover@oracle.com>

Use the new function that is simpler and faster.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 net/rds/info.c |    5 +----
 net/rds/rdma.c |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/net/rds/info.c b/net/rds/info.c
index 1d88553..62aeef3 100644
--- a/net/rds/info.c
+++ b/net/rds/info.c
@@ -188,10 +188,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
 		ret = -ENOMEM;
 		goto out;
 	}
-	down_read(&current->mm->mmap_sem);
-	ret = get_user_pages(current, current->mm, start, nr_pages, 1, 0,
-			     pages, NULL);
-	up_read(&current->mm->mmap_sem);
+	ret = get_user_pages_fast(start, nr_pages, 1, pages);
 	if (ret != nr_pages) {
 		if (ret > 0)
 			nr_pages = ret;
diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index e390dc7..8dc83d2 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -150,10 +150,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
 {
 	int ret;
 
-	down_read(&current->mm->mmap_sem);
-	ret = get_user_pages(current, current->mm, user_addr,
-			     nr_pages, write, 0, pages, NULL);
-	up_read(&current->mm->mmap_sem);
+	ret = get_user_pages_fast(user_addr, nr_pages, write, pages);
 
 	if (ret >= 0 && ret < nr_pages) {
 		while (ret--)
-- 
1.5.6.3


  parent reply	other threads:[~2009-04-10  0:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10  0:09 [PATCH net-next 0/12] RDS: updates for net-next Andy Grover
2009-04-10  0:09 ` [PATCH 01/12] RDS/IW+IB: Set recv ring low water mark to 1/2 full Andy Grover
2009-04-10  0:09 ` [PATCH 02/12] RDS: Correct some iw references in rdma_transport.c Andy Grover
2009-04-10  0:09 ` [PATCH 03/12] RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled Andy Grover
2009-04-10  0:09 ` [PATCH 04/12] RDS/IW+IB: Allow max credit advertise window Andy Grover
2009-04-10  0:09 ` [PATCH 05/12] RDS: Fix ordering in a conditional Andy Grover
2009-04-10  0:09 ` [PATCH 06/12] RDS: Establish connection before parsing CMSGs Andy Grover
2009-04-10  0:09 ` Andy Grover [this message]
2009-04-10  0:09 ` [PATCH 08/12] RDS: remove unused #include <version.h> Andy Grover
2009-04-10  0:09 ` [PATCH 09/12] rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset Andy Grover
2009-04-10  0:09 ` [PATCH 10/12] ERR_PTR() dereference in net/rds/iw.c Andy Grover
2009-04-10  0:09 ` [PATCH 11/12] ERR_PTR() dereference in net/rds/ib.c Andy Grover
2009-04-10  0:09 ` [PATCH 12/12] MAINTAINERS: rds list is moderated Andy Grover
2009-04-10  0:21 ` [PATCH net-next 0/12] RDS: updates for net-next David Miller

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=1239322187-3764-8-git-send-email-andy.grover@oracle.com \
    --to=andy.grover@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).