Skip to content

Commit 819f29c

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Acked-by: Dave Chinner <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 6dca5ab commit 819f29c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

fs/xfs/xfs_buf.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,21 +1657,17 @@ xfs_buf_submit(
16571657

16581658
if ((bp->b_flags & XBF_WRITE) && !xfs_buf_verify_write(bp)) {
16591659
xfs_force_shutdown(bp->b_mount, SHUTDOWN_CORRUPT_INCORE);
1660-
goto done;
1660+
xfs_buf_ioend(bp);
1661+
return;
16611662
}
16621663

16631664
/* In-memory targets are directly mapped, no I/O required. */
1664-
if (xfs_buftarg_is_mem(bp->b_target))
1665-
goto done;
1665+
if (xfs_buftarg_is_mem(bp->b_target)) {
1666+
xfs_buf_ioend(bp);
1667+
return;
1668+
}
16661669

16671670
xfs_buf_submit_bio(bp);
1668-
return;
1669-
1670-
done:
1671-
if (bp->b_error || !(bp->b_flags & XBF_ASYNC))
1672-
xfs_buf_ioend(bp);
1673-
else
1674-
xfs_buf_ioend_async(bp);
16751671
}
16761672

16771673
void *

0 commit comments

Comments
 (0)