Skip to content

Commit

Permalink
xfs: move kmem_to_page()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Chinner authored and Chandan Babu R committed Feb 13, 2024
1 parent f078d4e commit afdc115
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions fs/xfs/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */
11 changes: 11 additions & 0 deletions fs/xfs/xfs_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit afdc115

Please sign in to comment.