summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorTarun Sahu <tsahu@linux.ibm.com>2023-06-12 12:35:14 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-06-20 02:19:27 +0300
commit1e3be4856f49d55c60b6cd500297b06acfe216a9 (patch)
tree7d68f3f2ef878fc52b82f2c499d59d4b304e1c19 /mm
parent0bb488498c989e0d912d38b624df31922027c8c5 (diff)
downloadlinux-1e3be4856f49d55c60b6cd500297b06acfe216a9.tar.xz
mm/folio: replace set_compound_order with folio_set_order
The patch ("mm/folio: Avoid special handling for order value 0 in folio_set_order") [1] removed the need for special handling of order = 0 in folio_set_order. Now, folio_set_order and set_compound_order becomes similar function. This patch removes the set_compound_order and uses folio_set_order instead. [1] https://lore.kernel.org/all/20230609183032.13E08C433D2@smtp.kernel.org/ Link: https://lkml.kernel.org/r/20230612093514.689846-1-tsahu@linux.ibm.com Signed-off-by: Tarun Sahu <tsahu@linux.ibm.com> Reviewed-by Sidhartha Kumar <sidhartha.kumar@oracle.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/internal.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/mm/internal.h b/mm/internal.h
index 33b8b8f66af3..b0d8778dd910 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -387,12 +387,27 @@ extern void memblock_free_pages(struct page *page, unsigned long pfn,
unsigned int order);
extern void __free_pages_core(struct page *page, unsigned int order);
+/*
+ * This will have no effect, other than possibly generating a warning, if the
+ * caller passes in a non-large folio.
+ */
+static inline void folio_set_order(struct folio *folio, unsigned int order)
+{
+ if (WARN_ON_ONCE(!order || !folio_test_large(folio)))
+ return;
+
+ folio->_folio_order = order;
+#ifdef CONFIG_64BIT
+ folio->_folio_nr_pages = 1U << order;
+#endif
+}
+
static inline void prep_compound_head(struct page *page, unsigned int order)
{
struct folio *folio = (struct folio *)page;
folio_set_compound_dtor(folio, COMPOUND_PAGE_DTOR);
- set_compound_order(page, order);
+ folio_set_order(folio, order);
atomic_set(&folio->_entire_mapcount, -1);
atomic_set(&folio->_nr_pages_mapped, 0);
atomic_set(&folio->_pincount, 0);
@@ -432,21 +447,6 @@ void memmap_init_range(unsigned long, int, unsigned long, unsigned long,
int split_free_page(struct page *free_page,
unsigned int order, unsigned long split_pfn_offset);
-/*
- * This will have no effect, other than possibly generating a warning, if the
- * caller passes in a non-large folio.
- */
-static inline void folio_set_order(struct folio *folio, unsigned int order)
-{
- if (WARN_ON_ONCE(!order || !folio_test_large(folio)))
- return;
-
- folio->_folio_order = order;
-#ifdef CONFIG_64BIT
- folio->_folio_nr_pages = 1U << order;
-#endif
-}
-
#if defined CONFIG_COMPACTION || defined CONFIG_CMA
/*