Commit dc21e700 authored by Josef Bacik's avatar Josef Bacik Committed by Andrew Morton

mm: remove foll_flags in __get_user_pages

Now that we're not passing around a pointer to the flags, there's no
reason to have an extra variable for the gup_flags, simply pass the
gup_flags directly everywhere.

Link: https://lkml.kernel.org/r/1e79b84bd30287cc9847f2aeb002374e6e60a10f.1721337845.git.josef@toxicpanda.comSigned-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 47872953
...@@ -1437,7 +1437,6 @@ static long __get_user_pages(struct mm_struct *mm, ...@@ -1437,7 +1437,6 @@ static long __get_user_pages(struct mm_struct *mm,
do { do {
struct page *page; struct page *page;
unsigned int foll_flags = gup_flags;
unsigned int page_increm; unsigned int page_increm;
/* first iteration or cross vma bound */ /* first iteration or cross vma bound */
...@@ -1488,9 +1487,9 @@ static long __get_user_pages(struct mm_struct *mm, ...@@ -1488,9 +1487,9 @@ static long __get_user_pages(struct mm_struct *mm,
} }
cond_resched(); cond_resched();
page = follow_page_mask(vma, start, foll_flags, &ctx); page = follow_page_mask(vma, start, gup_flags, &ctx);
if (!page || PTR_ERR(page) == -EMLINK) { if (!page || PTR_ERR(page) == -EMLINK) {
ret = faultin_page(vma, start, foll_flags, ret = faultin_page(vma, start, gup_flags,
PTR_ERR(page) == -EMLINK, locked); PTR_ERR(page) == -EMLINK, locked);
switch (ret) { switch (ret) {
case 0: case 0:
...@@ -1547,13 +1546,12 @@ static long __get_user_pages(struct mm_struct *mm, ...@@ -1547,13 +1546,12 @@ static long __get_user_pages(struct mm_struct *mm,
* large folio, this should never fail. * large folio, this should never fail.
*/ */
if (try_grab_folio(folio, page_increm - 1, if (try_grab_folio(folio, page_increm - 1,
foll_flags)) { gup_flags)) {
/* /*
* Release the 1st page ref if the * Release the 1st page ref if the
* folio is problematic, fail hard. * folio is problematic, fail hard.
*/ */
gup_put_folio(folio, 1, gup_put_folio(folio, 1, gup_flags);
foll_flags);
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
} }
......
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