RDS: use get_user_pages_fast()
authorAndy Grover <andy.grover@oracle.com>
Thu, 9 Apr 2009 14:09:42 +0000 (14:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Apr 2009 00:21:20 +0000 (17:21 -0700)
Use the new function that is simpler and faster.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/info.c
net/rds/rdma.c

index 1d885535214dba2ba7567bed1b005e391fa9d675..62aeef37aefe772626644edfa1a1be318a725337 100644 (file)
@@ -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;
index e390dc70b9d95638a27fa7625cea11c784320f1b..8dc83d2caa58d02d7036ea697a5fac65f470b564 100644 (file)
@@ -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--)