From: Dave Chinner Date: Mon, 15 Jan 2024 22:59:41 +0000 (+1100) Subject: xfs: move kmem_to_page() X-Git-Tag: v6.9-rc1~129^2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=afdc115559c57a48ad697219cec1d16962ad9e30;p=thirdparty%2Flinux.git xfs: move kmem_to_page() Move it to the general xfs linux wrapper header file so we can prepare to remove kmem.h Signed-off-by: Dave Chinner Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R --- diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h index 1343f1a6f99b1..48e43f29f2a0d 100644 --- a/fs/xfs/kmem.h +++ b/fs/xfs/kmem.h @@ -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__ */ diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index d7873e0360f0b..666618b463c9d 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -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__ */