xfs: move kmem_to_page()
authorDave Chinner <dchinner@redhat.com>
Mon, 15 Jan 2024 22:59:41 +0000 (09:59 +1100)
committerChandan Babu R <chandanbabu@kernel.org>
Tue, 13 Feb 2024 12:37:34 +0000 (18:07 +0530)
Move it to the general xfs linux wrapper header file so we can
prepare to remove kmem.h

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/kmem.h
fs/xfs/xfs_linux.h

index 1343f1a6f99b1127ca37a598f2ddf880bf53de98..48e43f29f2a0d7070568c14ed9550a225045fad1 100644 (file)
@@ -20,15 +20,4 @@ static inline void  kmem_free(const void *ptr)
        kvfree(ptr);
 }
 
-/*
- * Zone interfaces
- */
-static inline struct page *
-kmem_to_page(void *addr)
-{
-       if (is_vmalloc_addr(addr))
-               return vmalloc_to_page(addr);
-       return virt_to_page(addr);
-}
-
 #endif /* __XFS_SUPPORT_KMEM_H__ */
index d7873e0360f0b9f170fc8cdaffa0ce49b1c5ed37..666618b463c9de00e992b66e32ea1e77881a2f42 100644 (file)
@@ -269,4 +269,15 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
 # define PTR_FMT "%p"
 #endif
 
+/*
+ * Helper for IO routines to grab backing pages from allocated kernel memory.
+ */
+static inline struct page *
+kmem_to_page(void *addr)
+{
+       if (is_vmalloc_addr(addr))
+               return vmalloc_to_page(addr);
+       return virt_to_page(addr);
+}
+
 #endif /* __XFS_LINUX__ */