summaryrefslogtreecommitdiff
path: root/mm/gup.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-10 05:03:47 +0300
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 19:56:35 +0300
commit28297dbcad7ed3d7bac373eef121339cb0cac326 (patch)
tree7cef7f20f2c94360cb197520bda72cdac27a1c53 /mm/gup.c
parent0b046e12ae5d6d286415a2e805fcfdd724b7add1 (diff)
downloadlinux-28297dbcad7ed3d7bac373eef121339cb0cac326.tar.xz
mm/gup: Change the calling convention for compound_next()
Return the head page instead of storing it to a passed parameter. Reorder the arguments to match the calling function's arguments. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Diffstat (limited to 'mm/gup.c')
-rw-r--r--mm/gup.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 30d1daef3957..15d5b3c6d21c 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -268,9 +268,8 @@ static inline struct page *compound_range_next(struct page *start,
return page;
}
-static inline void compound_next(unsigned long i, unsigned long npages,
- struct page **list, struct page **head,
- unsigned int *ntails)
+static inline struct page *compound_next(struct page **list,
+ unsigned long npages, unsigned long i, unsigned int *ntails)
{
struct page *page;
unsigned int nr;
@@ -281,8 +280,8 @@ static inline void compound_next(unsigned long i, unsigned long npages,
break;
}
- *head = page;
*ntails = nr - i;
+ return page;
}
/**
@@ -320,7 +319,7 @@ void unpin_user_pages_dirty_lock(struct page **pages, unsigned long npages,
}
for (index = 0; index < npages; index += ntails) {
- compound_next(index, npages, pages, &head, &ntails);
+ head = compound_next(pages, npages, index, &ntails);
/*
* Checking PageDirty at this point may race with
* clear_page_dirty_for_io(), but that's OK. Two key
@@ -409,7 +408,7 @@ void unpin_user_pages(struct page **pages, unsigned long npages)
return;
for (index = 0; index < npages; index += ntails) {
- compound_next(index, npages, pages, &head, &ntails);
+ head = compound_next(pages, npages, index, &ntails);
put_compound_head(head, ntails, FOLL_PIN);
}
}