On 1/24/23 12:34, Jason Gunthorpe wrote:
This is part of the internal function of gup.c and is only non-static so
that the parts of gup.c in the huge_memory.c and hugetlb.c can call it.
Put it in internal.h beside the similarly purposed try_grab_folio()
Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
---
include/linux/mm.h | 2 --
mm/internal.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>
thanks,
--
John Hubbard
NVIDIA
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c9db257f09b307..dfc2a88bc4a8ed 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1173,8 +1173,6 @@ static inline void get_page(struct page *page)
folio_get(page_folio(page));
}
-int __must_check try_grab_page(struct page *page, unsigned int flags);
-
static inline __must_check bool try_get_page(struct page *page)
{
page = compound_head(page);
diff --git a/mm/internal.h b/mm/internal.h
index ce462bf145b441..0f035bcaf133f5 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -852,6 +852,7 @@ int migrate_device_coherent_page(struct page *page);
* mm/gup.c
*/
struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
+int __must_check try_grab_page(struct page *page, unsigned int flags);
extern bool mirrored_kernelcore;