Commit 830eb7d5 authored by Andy Grover's avatar Andy Grover Committed by David S. Miller

RDS: use get_user_pages_fast()

Use the new function that is simpler and faster.
Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49f69691
...@@ -188,10 +188,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval, ...@@ -188,10 +188,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
down_read(&current->mm->mmap_sem); ret = get_user_pages_fast(start, nr_pages, 1, pages);
ret = get_user_pages(current, current->mm, start, nr_pages, 1, 0,
pages, NULL);
up_read(&current->mm->mmap_sem);
if (ret != nr_pages) { if (ret != nr_pages) {
if (ret > 0) if (ret > 0)
nr_pages = ret; nr_pages = ret;
......
...@@ -150,10 +150,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages, ...@@ -150,10 +150,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
{ {
int ret; int ret;
down_read(&current->mm->mmap_sem); ret = get_user_pages_fast(user_addr, nr_pages, write, pages);
ret = get_user_pages(current, current->mm, user_addr,
nr_pages, write, 0, pages, NULL);
up_read(&current->mm->mmap_sem);
if (ret >= 0 && ret < nr_pages) { if (ret >= 0 && ret < nr_pages) {
while (ret--) while (ret--)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment