Skip to content

Commit af5c4be

Browse files
Christoph HellwigAlex Elder
authored andcommitted
xfs: remove buffers from the delwri list in xfs_buf_stale
For each call to xfs_buf_stale we call xfs_buf_delwri_dequeue either directly before or after it, or are guaranteed by the surrounding conditionals that we are never called on delwri buffers. Simply this situation by moving the call to xfs_buf_delwri_dequeue into xfs_buf_stale. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
1 parent c867cb6 commit af5c4be

5 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎fs/xfs/xfs_attr.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,6 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
21692169
bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK);
21702170
if (bp) {
21712171
xfs_buf_stale(bp);
2172-
xfs_buf_delwri_dequeue(bp);
21732172
xfs_buf_relse(bp);
21742173
bp = NULL;
21752174
}

‎fs/xfs/xfs_buf.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ xfs_buf_stale(
151151
struct xfs_buf *bp)
152152
{
153153
bp->b_flags |= XBF_STALE;
154+
xfs_buf_delwri_dequeue(bp);
154155
atomic_set(&(bp)->b_lru_ref, 0);
155156
if (!list_empty(&bp->b_lru)) {
156157
struct xfs_buftarg *btp = bp->b_target;
@@ -1059,7 +1060,6 @@ xfs_bioerror(
10591060
* We're calling xfs_buf_ioend, so delete XBF_DONE flag.
10601061
*/
10611062
XFS_BUF_UNREAD(bp);
1062-
xfs_buf_delwri_dequeue(bp);
10631063
XFS_BUF_UNDONE(bp);
10641064
xfs_buf_stale(bp);
10651065

@@ -1088,7 +1088,6 @@ xfs_bioerror_relse(
10881088
* change that interface.
10891089
*/
10901090
XFS_BUF_UNREAD(bp);
1091-
xfs_buf_delwri_dequeue(bp);
10921091
XFS_BUF_DONE(bp);
10931092
xfs_buf_stale(bp);
10941093
bp->b_iodone = NULL;

‎fs/xfs/xfs_buf_item.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,6 @@ xfs_buf_iodone_callbacks(
967967
*/
968968
if (XFS_FORCED_SHUTDOWN(mp)) {
969969
xfs_buf_stale(bp);
970-
xfs_buf_delwri_dequeue(bp);
971970
XFS_BUF_DONE(bp);
972971
trace_xfs_buf_item_iodone(bp, _RET_IP_);
973972
goto do_callbacks;
@@ -1009,7 +1008,6 @@ xfs_buf_iodone_callbacks(
10091008
*/
10101009
xfs_buf_stale(bp);
10111010
XFS_BUF_DONE(bp);
1012-
xfs_buf_delwri_dequeue(bp);
10131011

10141012
trace_xfs_buf_error_relse(bp, _RET_IP_);
10151013

‎fs/xfs/xfs_rw.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ xfs_read_buf(
149149
}
150150
if (bp) {
151151
XFS_BUF_UNDONE(bp);
152-
xfs_buf_delwri_dequeue(bp);
153152
xfs_buf_stale(bp);
154153
/*
155154
* brelse clears B_ERROR and b_error

‎fs/xfs/xfs_trans_buf.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ xfs_trans_get_buf(xfs_trans_t *tp,
162162
ASSERT(xfs_buf_islocked(bp));
163163
if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
164164
xfs_buf_stale(bp);
165-
xfs_buf_delwri_dequeue(bp);
166165
XFS_BUF_DONE(bp);
167166
}
168167

@@ -391,7 +390,6 @@ xfs_trans_read_buf(
391390
if (bp->b_error) {
392391
error = bp->b_error;
393392
xfs_buf_stale(bp);
394-
xfs_buf_delwri_dequeue(bp);
395393
XFS_BUF_DONE(bp);
396394
xfs_ioerror_alert("xfs_trans_read_buf", mp,
397395
bp, blkno);
@@ -744,7 +742,6 @@ xfs_trans_binval(
744742
* We set the stale bit in the buffer as well since we're getting
745743
* rid of it.
746744
*/
747-
xfs_buf_delwri_dequeue(bp);
748745
xfs_buf_stale(bp);
749746
bip->bli_flags |= XFS_BLI_STALE;
750747
bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);

0 commit comments

Comments
 (0)