summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2025-01-13 15:12:15 +0100
committerCarlos Maiolino <cem@kernel.org>2025-01-14 11:38:15 +0100
commit6dca5abb3d10e27e919e5344ac07e057f443c318 (patch)
treedddba99ddf987c0da6590c99f8107ca05a1b6daf
parent5c82a471c2b71357f6319f6ec34d20691969a6ba (diff)
xfs: remove the extra buffer reference in xfs_buf_submit
Nothing touches the buffer after it has been submitted now, so the need for the extra transient reference went away as well. 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>
-rw-r--r--fs/xfs/xfs_buf.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index e0a34c2aaaaf..49d087d9ba48 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1643,13 +1643,6 @@ xfs_buf_submit(
return;
}
- /*
- * Grab a reference so the buffer does not go away underneath us. For
- * async buffers, I/O completion drops the callers reference, which
- * could occur before submission returns.
- */
- xfs_buf_hold(bp);
-
if (bp->b_flags & XBF_WRITE)
xfs_buf_wait_unpin(bp);
@@ -1672,20 +1665,13 @@ xfs_buf_submit(
goto done;
xfs_buf_submit_bio(bp);
- goto rele;
+ return;
done:
if (bp->b_error || !(bp->b_flags & XBF_ASYNC))
xfs_buf_ioend(bp);
else
xfs_buf_ioend_async(bp);
-rele:
- /*
- * Release the hold that keeps the buffer referenced for the entire
- * I/O. Note that if the buffer is async, it is not safe to reference
- * after this release.
- */
- xfs_buf_rele(bp);
}
void *