VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-07 11:03:45 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-07 11:03:45 -0700 commit: cd1adf1b63a112d762832e9c64b0a886fbb840d6 parent: 4b93c544e90e2b28326182d31ee008eb80e02074
Commit Summary:
Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
Diffstat:
1 file changed, 4 insertions, 17 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 9935a4480710..886d6148d3d0 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -62,24 +62,11 @@ static void put_page_refs(struct page *page, int refs)
 	put_page(page);
 }
 
-/**
- * try_get_compound_head() - return the compound head page with refcount
- * appropriately incremented, or NULL if that failed.
- *
- * This handles potential refcount overflow correctly. It also works correctly
- * for various lockless get_user_pages()-related callers, due to the use of
- * page_cache_add_speculative().
- *
- * Even though the name includes "compound_head", this function is still
- * appropriate for callers that have a non-compound @page to get.
- *
- * @page:  pointer to page to be gotten
- * @refs:  the value to add to the page's refcount
- *
- * Return: head page (with refcount appropriately incremented) for success, or
- * NULL upon failure.
+/*
+ * Return the compound head page with ref appropriately incremented,
+ * or NULL if that failed.
  */
-struct page *try_get_compound_head(struct page *page, int refs)
+static inline struct page *try_get_compound_head(struct page *page, int refs)
 {
 	struct page *head = compound_head(page);