summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-12 20:23:05 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:17 -0700
commita9595b305c0f6cbbf9505325509d95637f6a7062 (patch)
treed7d55350b5baa86e47a1fd7cdfef147d2e40528d
parentda08e9b7932345aff0a748c55f8a25709505f2a3 (diff)
downloadlinux-a9595b305c0f6cbbf9505325509d95637f6a7062.tar.gz
linux-a9595b305c0f6cbbf9505325509d95637f6a7062.tar.bz2
linux-a9595b305c0f6cbbf9505325509d95637f6a7062.zip
mm: add folio_mapping_flags()
This is the equivalent of PageMappingFlags and is needed for converting mm/migrate.c to folios. Link: https://lkml.kernel.org/r/20220504182857.4013401-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--include/linux/page-flags.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index b70124b9c7c1..97eb88dbcbbc 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -650,6 +650,11 @@ __PAGEFLAG(Reported, reported, PF_NO_COMPOUND)
#define PAGE_MAPPING_KSM (PAGE_MAPPING_ANON | PAGE_MAPPING_MOVABLE)
#define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_MOVABLE)
+static __always_inline bool folio_mapping_flags(struct folio *folio)
+{
+ return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) != 0;
+}
+
static __always_inline int PageMappingFlags(struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) != 0;