diff mbox series

[v2,25/26] mm: Add folio_test_movable()

Message ID 20220504182857.4013401-26-willy@infradead.org (mailing list archive)
State New
Headers show
Series Folio patches for 5.19 | expand

Commit Message

Matthew Wilcox May 4, 2022, 6:28 p.m. UTC
This is the folio equivalent of PageMovable() which is needed to
convert mm/migrate.c to folios.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/migrate.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Christoph Hellwig May 5, 2022, 3:42 p.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 90e75d5a54d6..8b9d1e3d243d 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -100,6 +100,11 @@  static inline void __ClearPageMovable(struct page *page)
 }
 #endif
 
+static inline bool folio_test_movable(struct folio *folio)
+{
+	return PageMovable(&folio->page);
+}
+
 #ifdef CONFIG_NUMA_BALANCING
 extern int migrate_misplaced_page(struct page *page,
 				  struct vm_area_struct *vma, int node);