RDS: use get_user_pages_fast()

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>
This commit is contained in:
Andy Grover 2009-04-09 14:09:42 +00:00 committed by David S. Miller
parent 49f6969141
commit 830eb7d56c
2 changed files with 2 additions and 8 deletions

View 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;

View 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--)