mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
mm: add folio_is_pci_p2pdma()
Reimplement is_pci_p2pdma_page() in terms of folio_is_pci_p2pdma(). Moves the page_folio() call from inside page_pgmap() to is_pci_p2pdma_page(). This removes a page_folio() call from try_grab_folio() which already has a folio and can pass it in. Link: https://lkml.kernel.org/r/20250805172307.1302730-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Shakeel Butt <shakeel.butt@linux.dev> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
c995ac3aa3
commit
88df6ab2f3
@@ -170,11 +170,17 @@ static inline bool is_device_private_page(const struct page *page)
|
||||
folio_is_device_private(page_folio(page));
|
||||
}
|
||||
|
||||
static inline bool folio_is_pci_p2pdma(const struct folio *folio)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_PCI_P2PDMA) &&
|
||||
folio_is_zone_device(folio) &&
|
||||
folio->pgmap->type == MEMORY_DEVICE_PCI_P2PDMA;
|
||||
}
|
||||
|
||||
static inline bool is_pci_p2pdma_page(const struct page *page)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_PCI_P2PDMA) &&
|
||||
is_zone_device_page(page) &&
|
||||
page_pgmap(page)->type == MEMORY_DEVICE_PCI_P2PDMA;
|
||||
folio_is_pci_p2pdma(page_folio(page));
|
||||
}
|
||||
|
||||
static inline bool folio_is_device_coherent(const struct folio *folio)
|
||||
|
||||
Reference in New Issue
Block a user