diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-28 19:27:19 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-06-28 19:27:19 -0700 |
commit | 72945d86ddec143ee5064f36eae4b48b03ea1a3f (patch) | |
tree | 971c0ac3ccbecfec6aac4086a9f45848f680d6fd /fs/xfs/xfs_buf.c | |
parent | ce89755cdfeaa0073341f8b5d07caff4fa9fc316 (diff) | |
download | lwn-72945d86ddec143ee5064f36eae4b48b03ea1a3f.tar.gz lwn-72945d86ddec143ee5064f36eae4b48b03ea1a3f.zip |
xfs: make mem_to_page available outside of xfs_buf.c
Rename the function to kmem_to_page and move it to kmem.h together
with our kmem_large allocator that may either return kmalloced or
vmalloc pages.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r-- | fs/xfs/xfs_buf.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index e860114e8c9b..f455995f9278 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -934,17 +934,6 @@ xfs_buf_set_empty( bp->b_maps[0].bm_len = bp->b_length; } -static inline struct page * -mem_to_page( - void *addr) -{ - if ((!is_vmalloc_addr(addr))) { - return virt_to_page(addr); - } else { - return vmalloc_to_page(addr); - } -} - int xfs_buf_associate_memory( xfs_buf_t *bp, @@ -977,7 +966,7 @@ xfs_buf_associate_memory( bp->b_offset = offset; for (i = 0; i < bp->b_page_count; i++) { - bp->b_pages[i] = mem_to_page((void *)pageaddr); + bp->b_pages[i] = kmem_to_page((void *)pageaddr); pageaddr += PAGE_SIZE; } |