]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: remove xfs_buf_ioend
authorChristoph Hellwig <hch@lst.de>
Thu, 25 Jun 2026 13:58:34 +0000 (15:58 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 1 Jul 2026 10:29:50 +0000 (12:29 +0200)
There are two callers of xfs_buf_ioend, one of which always has the
XBF_ASYNC flag set.  Open code the logic in both callers to prepare for a
bug fix.

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

index aa4317793c574fd4da139310a55108c6d39190d9..f5e23c8b07b6d89b03871e8b71ac67db7f48c946 100644 (file)
@@ -1146,18 +1146,6 @@ __xfs_buf_ioend(
        return true;
 }
 
-static void
-xfs_buf_ioend(
-       struct xfs_buf  *bp)
-{
-       if (!__xfs_buf_ioend(bp))
-               return;
-       if (bp->b_flags & XBF_ASYNC)
-               xfs_buf_relse(bp);
-       else
-               complete(&bp->b_iowait);
-}
-
 static void
 xfs_buf_ioend_work(
        struct work_struct      *work)
@@ -1207,7 +1195,8 @@ xfs_buf_fail(
        bp->b_flags &= ~XBF_DONE;
        xfs_buf_stale(bp);
        xfs_buf_ioerror(bp, -EIO);
-       xfs_buf_ioend(bp);
+       if (__xfs_buf_ioend(bp))
+               xfs_buf_relse(bp);
 }
 
 int
@@ -1415,7 +1404,12 @@ ioerror:
        bp->b_flags &= ~XBF_DONE;
        xfs_buf_stale(bp);
 end_io:
-       xfs_buf_ioend(bp);
+       if (!__xfs_buf_ioend(bp))
+               return;
+       if (bp->b_flags & XBF_ASYNC)
+               xfs_buf_relse(bp);
+       else
+               complete(&bp->b_iowait);
 }
 
 /*