diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 12:57:38 -0400 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 12:57:38 -0400 |
commit | 536939ff516382b391a0039262e27fc80c7b3924 (patch) | |
tree | 8f4e3afb1d9b4807d2d7e6707873c6f6c662da75 /include/linux/memremap.h | |
parent | d1d8a3b4d06d8c9188f2b9b89ef053db0bf899de (diff) | |
download | lwn-536939ff516382b391a0039262e27fc80c7b3924.tar.gz lwn-536939ff516382b391a0039262e27fc80c7b3924.zip |
mm: Add three folio wrappers
folio_is_zone_device() is equivalent to is_zone_device_page(),
folio_is_device_private() is equivalent to is_device_private_page(),
and folio_is_pinnable() is equivalent to is_pinnable_page().
All of these tests return the same result for every page in the folio,
so we can just pass the head page of the folio to the page variant of
the function.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'include/linux/memremap.h')
-rw-r--r-- | include/linux/memremap.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/memremap.h b/include/linux/memremap.h index d6a114dd5ea8..8af304f6b504 100644 --- a/include/linux/memremap.h +++ b/include/linux/memremap.h @@ -138,6 +138,11 @@ static inline bool is_device_private_page(const struct page *page) page->pgmap->type == MEMORY_DEVICE_PRIVATE; } +static inline bool folio_is_device_private(const struct folio *folio) +{ + return is_device_private_page(&folio->page); +} + static inline bool is_pci_p2pdma_page(const struct page *page) { return IS_ENABLED(CONFIG_PCI_P2PDMA) && |