diff options
author | 2025-01-13 15:12:16 +0100 | |
---|---|---|
committer | 2025-01-14 11:38:15 +0100 | |
commit | 819f29cc7be6a9d949e017ca3f5ccc772a80daef (patch) | |
tree | 2986d16fd852d57714196a6c80ba262a5e0e8b60 | |
parent | xfs: remove the extra buffer reference in xfs_buf_submit (diff) | |
download | wireguard-linux-819f29cc7be6a9d949e017ca3f5ccc772a80daef.tar.xz wireguard-linux-819f29cc7be6a9d949e017ca3f5ccc772a80daef.zip |
xfs: always complete the buffer inline in xfs_buf_submit
xfs_buf_submit now only completes a buffer on error, or for in-memory
buftargs. There is no point in using a workqueue for the latter as
the completion will just wake up the caller. Optimize this case by
avoiding the workqueue roundtrip.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/xfs/xfs_buf.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 49d087d9ba48..8e795ccd57d6 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1657,21 +1657,17 @@ xfs_buf_submit( if ((bp->b_flags & XBF_WRITE) && !xfs_buf_verify_write(bp)) { xfs_force_shutdown(bp->b_mount, SHUTDOWN_CORRUPT_INCORE); - goto done; + xfs_buf_ioend(bp); + return; } /* In-memory targets are directly mapped, no I/O required. */ - if (xfs_buftarg_is_mem(bp->b_target)) - goto done; + if (xfs_buftarg_is_mem(bp->b_target)) { + xfs_buf_ioend(bp); + return; + } xfs_buf_submit_bio(bp); - return; - -done: - if (bp->b_error || !(bp->b_flags & XBF_ASYNC)) - xfs_buf_ioend(bp); - else - xfs_buf_ioend_async(bp); } void * |