diff mbox series

[12/15] xfs: always complete the buffer inline in xfs_buf_submit

Message ID 20250106095613.847700-13-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/15] xfs: fix a double completion for buffers on in-memory targets | expand

Commit Message

Christoph Hellwig Jan. 6, 2025, 9:54 a.m. UTC
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>
---
 fs/xfs/xfs_buf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Darrick J. Wong Jan. 7, 2025, 6:46 a.m. UTC | #1
On Mon, Jan 06, 2025 at 10:54:49AM +0100, Christoph Hellwig wrote:
> 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>

This all seems simpler now...
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_buf.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 352cc50aeea5..0ad3cacfdba1 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1670,10 +1670,7 @@ xfs_buf_submit(
>  	xfs_buf_submit_bio(bp);
>  	return 0;
>  done:
> -	if (bp->b_error || !(bp->b_flags & XBF_ASYNC))
> -		xfs_buf_ioend(bp);
> -	else
> -		xfs_buf_ioend_async(bp);
> +	xfs_buf_ioend(bp);
>  	return 0;
>  }
>  
> -- 
> 2.45.2
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 352cc50aeea5..0ad3cacfdba1 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1670,10 +1670,7 @@  xfs_buf_submit(
 	xfs_buf_submit_bio(bp);
 	return 0;
 done:
-	if (bp->b_error || !(bp->b_flags & XBF_ASYNC))
-		xfs_buf_ioend(bp);
-	else
-		xfs_buf_ioend_async(bp);
+	xfs_buf_ioend(bp);
 	return 0;
 }