[PATCH 4/5] xfs: remove unused kmem_to_page helper

From: Zizhi Wo

Date: Fri Sep 04 2026 - 02:34:16 EST


From: Zizhi Wo <wozizhi@xxxxxxxxxx>

Commit 5ced480d4886 ("xfs: simplify building the bio in xlog_write_iclog")
switched the log I/O path to the bio_add_virt_nofail and bio_add_vmalloc
helpers, removing the last caller of kmem_to_page(). The helper itself was
left behind in xfs_platform.h and nothing has referenced it.

Remove the stale helper.

Assisted-by: Claude-Code:GLM-5.2
Signed-off-by: Zizhi Wo <wozizhi@xxxxxxxxxx>
---
Note: this helper was only recently orphaned by 5ced480d4886 since 2025. If
it's intended to be kept for upcoming bio/vmalloc work, please just drop
this patch.

fs/xfs/xfs_platform.h | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/fs/xfs/xfs_platform.h b/fs/xfs/xfs_platform.h
index 59a33c60e0ca..5d542e95fe44 100644
--- a/fs/xfs/xfs_platform.h
+++ b/fs/xfs/xfs_platform.h
@@ -289,15 +289,4 @@ 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_PLATFORM_H */
--
2.52.0