aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSidhartha Kumar <[email protected]>2022-12-14 22:17:57 -0800
committerAndrew Morton <[email protected]>2023-01-18 17:12:36 -0800
commit04a42e72d77a93a166b79c34b7bc862f55a53967 (patch)
tree09f4b6030f6d61881d226f92afb7fb6cb8ee14d6 /include/linux
parent1301f9313484f9eeb09904988b2aabd398492797 (diff)
mm: move folio_set_compound_order() to mm/internal.h
folio_set_compound_order() is moved to an mm-internal location so external folio users cannot misuse this function. Change the name of the function to folio_set_order() and use WARN_ON_ONCE() rather than BUG_ON. Also, handle the case if a non-large folio is passed and add clarifying comments to the function. Link: https://lore.kernel.org/lkml/[email protected]/T/ Link: https://lkml.kernel.org/r/[email protected] Fixes: 9fd330582b2f ("mm: add folio dtor and order setter functions") Signed-off-by: Sidhartha Kumar <[email protected]> Suggested-by: Mike Kravetz <[email protected]> Suggested-by: Muchun Song <[email protected]> Suggested-by: Matthew Wilcox <[email protected]> Suggested-by: John Hubbard <[email protected]> Reviewed-by: John Hubbard <[email protected]> Reviewed-by: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8f857163ac89..253b2d7489e6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1019,22 +1019,6 @@ static inline void set_compound_order(struct page *page, unsigned int order)
#endif
}
-/*
- * folio_set_compound_order is generally passed a non-zero order to
- * initialize a large folio. However, hugetlb code abuses this by
- * passing in zero when 'dissolving' a large folio.
- */
-static inline void folio_set_compound_order(struct folio *folio,
- unsigned int order)
-{
- VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
-
- folio->_folio_order = order;
-#ifdef CONFIG_64BIT
- folio->_folio_nr_pages = order ? 1U << order : 0;
-#endif
-}
-
/* Returns the number of pages in this potentially compound page. */
static inline unsigned long compound_nr(struct page *page)
{