diff options
author | Christoph Hellwig <hch@lst.de> | 2025-03-10 14:19:14 +0100 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2025-03-10 14:29:44 +0100 |
commit | e614a00117bc2d46219c66a287ddde0f0a04517c (patch) | |
tree | d0aaf5496689921ac3d46d02abb5deffb34eabc1 /fs/xfs/xfs_buf.c | |
parent | e2874632a6213b4687e53cd7d837c642c805c903 (diff) |
xfs: cleanup mapping tmpfs folios into the buffer cache
Directly assign b_addr based on the tmpfs folios without a detour
through pages, reuse the folio_put path used for non-tmpfs buffers
and replace all references to pages in comments with folios.
Partially based on a patch from Dave Chinner <dchinner@redhat.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r-- | fs/xfs/xfs_buf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4aaa588330e4..a7430fcd8301 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -206,9 +206,7 @@ xfs_buf_free( if (!xfs_buftarg_is_mem(bp->b_target) && size >= PAGE_SIZE) mm_account_reclaimed_pages(howmany(size, PAGE_SHIFT)); - if (xfs_buftarg_is_mem(bp->b_target)) - xmbuf_unmap_page(bp); - else if (is_vmalloc_addr(bp->b_addr)) + if (is_vmalloc_addr(bp->b_addr)) vfree(bp->b_addr); else if (bp->b_flags & _XBF_KMEM) kfree(bp->b_addr); @@ -275,7 +273,7 @@ xfs_buf_alloc_backing_mem( struct folio *folio; if (xfs_buftarg_is_mem(bp->b_target)) - return xmbuf_map_page(bp); + return xmbuf_map_backing_mem(bp); /* Assure zeroed buffer for non-read cases. */ if (!(flags & XBF_READ)) |