]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: move invalidate_kernel_vmap_range to xfs_buf_ioend
authorChristoph Hellwig <hch@lst.de>
Thu, 2 Jan 2025 15:38:01 +0000 (16:38 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 13 Jan 2025 04:17:37 +0000 (05:17 +0100)
Invalidating cache lines can be fairly expensive, so don't do it
in interrupt context.  Note that in practice very few setup will
actually do anything here as virtually indexed caches are rather
uncommon, but we might as well move the call to the proper place
while touching this area.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fs/xfs/xfs_buf.c

index e9fc546c24480e06a28b8c04ae0ec3fa73884b31..ea0a0c344dd27e0e6454593efe8db5ba1c5669a0 100644 (file)
@@ -1364,6 +1364,9 @@ xfs_buf_ioend(
        trace_xfs_buf_iodone(bp, _RET_IP_);
 
        if (bp->b_flags & XBF_READ) {
+               if (!bp->b_error && xfs_buf_is_vmapped(bp))
+                       invalidate_kernel_vmap_range(bp->b_addr,
+                                       xfs_buf_vmap_len(bp));
                if (!bp->b_error && bp->b_ops)
                        bp->b_ops->verify_read(bp);
                if (!bp->b_error)
@@ -1493,9 +1496,6 @@ xfs_buf_bio_end_io(
                 XFS_TEST_ERROR(false, bp->b_mount, XFS_ERRTAG_BUF_IOERROR))
                xfs_buf_ioerror(bp, -EIO);
 
-       if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
-               invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
-
        xfs_buf_ioend_async(bp);
        bio_put(bio);
 }