Skip to content

Commit 6dca5ab

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

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,13 +1643,6 @@ xfs_buf_submit(
16431643
return;
16441644
}
16451645

1646-
/*
1647-
* Grab a reference so the buffer does not go away underneath us. For
1648-
* async buffers, I/O completion drops the callers reference, which
1649-
* could occur before submission returns.
1650-
*/
1651-
xfs_buf_hold(bp);
1652-
16531646
if (bp->b_flags & XBF_WRITE)
16541647
xfs_buf_wait_unpin(bp);
16551648

@@ -1672,20 +1665,13 @@ xfs_buf_submit(
16721665
goto done;
16731666

16741667
xfs_buf_submit_bio(bp);
1675-
goto rele;
1668+
return;
16761669

16771670
done:
16781671
if (bp->b_error || !(bp->b_flags & XBF_ASYNC))
16791672
xfs_buf_ioend(bp);
16801673
else
16811674
xfs_buf_ioend_async(bp);
1682-
rele:
1683-
/*
1684-
* Release the hold that keeps the buffer referenced for the entire
1685-
* I/O. Note that if the buffer is async, it is not safe to reference
1686-
* after this release.
1687-
*/
1688-
xfs_buf_rele(bp);
16891675
}
16901676

16911677
void *

0 commit comments

Comments
 (0)