summaryrefslogtreecommitdiffstats
path: root/mm/gup.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-07-18 23:26:07 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-09-02 05:25:46 +0200
commitdc21e70079ffcc4b8f14603cdd120713f0400dd3 (patch)
tree0b91c693a51d6b2e2d8ddd9480eb6295f1c4b4b2 /mm/gup.c
parentmm: cleanup flags usage in faultin_page (diff)
downloadlinux-dc21e70079ffcc4b8f14603cdd120713f0400dd3.tar.xz
linux-dc21e70079ffcc4b8f14603cdd120713f0400dd3.zip
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.com Signed-off-by: Josef Bacik <josef@toxicpanda.com> Acked-by: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/gup.c')
-rw-r--r--mm/gup.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 985d5141592f..120740cf5a34 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1437,7 +1437,6 @@ static long __get_user_pages(struct mm_struct *mm,
do {
struct page *page;
- unsigned int foll_flags = gup_flags;
unsigned int page_increm;
/* first iteration or cross vma bound */
@@ -1488,9 +1487,9 @@ retry:
}
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) {
- ret = faultin_page(vma, start, foll_flags,
+ ret = faultin_page(vma, start, gup_flags,
PTR_ERR(page) == -EMLINK, locked);
switch (ret) {
case 0:
@@ -1547,13 +1546,12 @@ next_page:
* large folio, this should never fail.
*/
if (try_grab_folio(folio, page_increm - 1,
- foll_flags)) {
+ gup_flags)) {
/*
* Release the 1st page ref if the
* folio is problematic, fail hard.
*/
- gup_put_folio(folio, 1,
- foll_flags);
+ gup_put_folio(folio, 1, gup_flags);
ret = -EFAULT;
goto out;
}