Commit bc26cb8c authored by Andrea Arcangeli's avatar Andrea Arcangeli

mm: gup: use get_user_pages_fast instead of get_user_pages_unlocked

Just an optimization, where possible use get_user_pages_fast.
parent 051bd3c6
...@@ -4552,13 +4552,10 @@ static int sgl_map_user_pages(struct st_buffer *STbp, ...@@ -4552,13 +4552,10 @@ static int sgl_map_user_pages(struct st_buffer *STbp,
/* Try to fault in all of the necessary pages */ /* Try to fault in all of the necessary pages */
/* rw==READ means read from drive, write into memory area */ /* rw==READ means read from drive, write into memory area */
res = get_user_pages_unlocked( res = get_user_pages_fast(
current,
current->mm,
uaddr, uaddr,
nr_pages, nr_pages,
rw == READ, rw == READ,
0, /* don't force */
pages); pages);
/* Errors and no page mapped should return here */ /* Errors and no page mapped should return here */
......
...@@ -686,8 +686,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, ...@@ -686,8 +686,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
if (!pages) if (!pages)
return -ENOMEM; return -ENOMEM;
ret = get_user_pages_unlocked(current, current->mm, (unsigned long)buf, ret = get_user_pages_fast((unsigned long)buf, nr_pages, WRITE, pages);
nr_pages, WRITE, 0, pages);
if (ret < nr_pages) { if (ret < nr_pages) {
nr_pages = ret; nr_pages = ret;
......
...@@ -24,9 +24,10 @@ struct page **ceph_get_direct_page_vector(const void __user *data, ...@@ -24,9 +24,10 @@ struct page **ceph_get_direct_page_vector(const void __user *data,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
while (got < num_pages) { while (got < num_pages) {
rc = get_user_pages_unlocked(current, current->mm, rc = get_user_pages_fast((unsigned long)data +
(unsigned long)data + ((unsigned long)got * PAGE_SIZE), ((unsigned long)got * PAGE_SIZE),
num_pages - got, write_page, 0, pages + got); num_pages - got,
write_page, pages + got);
if (rc < 0) if (rc < 0)
break; break;
BUG_ON(rc == 0); BUG_ON(rc == 0);
......
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