aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-10-10 12:52:47 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:10 -0400
commitaf5c4bee499eb68bc36ca046030394d82d0e3669 (patch)
tree4d015bdd36d9c424e04c8aaf8050dccb79cd7c31 /fs/xfs
parentc867cb61641751fd3d86350232d64ae2a10137d4 (diff)
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_attr.c1
-rw-r--r--fs/xfs/xfs_buf.c3
-rw-r--r--fs/xfs/xfs_buf_item.c2
-rw-r--r--fs/xfs/xfs_rw.c1
-rw-r--r--fs/xfs/xfs_trans_buf.c3
5 files changed, 1 insertions, 9 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index ae8f917490d4..1e5d97f86ea8 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -2169,7 +2169,6 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
2169 bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK); 2169 bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK);
2170 if (bp) { 2170 if (bp) {
2171 xfs_buf_stale(bp); 2171 xfs_buf_stale(bp);
2172 xfs_buf_delwri_dequeue(bp);
2173 xfs_buf_relse(bp); 2172 xfs_buf_relse(bp);
2174 bp = NULL; 2173 bp = NULL;
2175 } 2174 }
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index f88eab9e8144..3df7d0a2b245 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -151,6 +151,7 @@ xfs_buf_stale(
151 struct xfs_buf *bp) 151 struct xfs_buf *bp)
152{ 152{
153 bp->b_flags |= XBF_STALE; 153 bp->b_flags |= XBF_STALE;
154 xfs_buf_delwri_dequeue(bp);
154 atomic_set(&(bp)->b_lru_ref, 0); 155 atomic_set(&(bp)->b_lru_ref, 0);
155 if (!list_empty(&bp->b_lru)) { 156 if (!list_empty(&bp->b_lru)) {
156 struct xfs_buftarg *btp = bp->b_target; 157 struct xfs_buftarg *btp = bp->b_target;
@@ -1059,7 +1060,6 @@ xfs_bioerror(
1059 * We're calling xfs_buf_ioend, so delete XBF_DONE flag. 1060 * We're calling xfs_buf_ioend, so delete XBF_DONE flag.
1060 */ 1061 */
1061 XFS_BUF_UNREAD(bp); 1062 XFS_BUF_UNREAD(bp);
1062 xfs_buf_delwri_dequeue(bp);
1063 XFS_BUF_UNDONE(bp); 1063 XFS_BUF_UNDONE(bp);
1064 xfs_buf_stale(bp); 1064 xfs_buf_stale(bp);
1065 1065
@@ -1088,7 +1088,6 @@ xfs_bioerror_relse(
1088 * change that interface. 1088 * change that interface.
1089 */ 1089 */
1090 XFS_BUF_UNREAD(bp); 1090 XFS_BUF_UNREAD(bp);
1091 xfs_buf_delwri_dequeue(bp);
1092 XFS_BUF_DONE(bp); 1091 XFS_BUF_DONE(bp);
1093 xfs_buf_stale(bp); 1092 xfs_buf_stale(bp);
1094 bp->b_iodone = NULL; 1093 bp->b_iodone = NULL;
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 8213f4a753dc..06a76ca99659 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -967,7 +967,6 @@ xfs_buf_iodone_callbacks(
967 */ 967 */
968 if (XFS_FORCED_SHUTDOWN(mp)) { 968 if (XFS_FORCED_SHUTDOWN(mp)) {
969 xfs_buf_stale(bp); 969 xfs_buf_stale(bp);
970 xfs_buf_delwri_dequeue(bp);
971 XFS_BUF_DONE(bp); 970 XFS_BUF_DONE(bp);
972 trace_xfs_buf_item_iodone(bp, _RET_IP_); 971 trace_xfs_buf_item_iodone(bp, _RET_IP_);
973 goto do_callbacks; 972 goto do_callbacks;
@@ -1009,7 +1008,6 @@ xfs_buf_iodone_callbacks(
1009 */ 1008 */
1010 xfs_buf_stale(bp); 1009 xfs_buf_stale(bp);
1011 XFS_BUF_DONE(bp); 1010 XFS_BUF_DONE(bp);
1012 xfs_buf_delwri_dequeue(bp);
1013 1011
1014 trace_xfs_buf_error_relse(bp, _RET_IP_); 1012 trace_xfs_buf_error_relse(bp, _RET_IP_);
1015 1013
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index ff33645fe62d..86f1928b4cfa 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -149,7 +149,6 @@ xfs_read_buf(
149 } 149 }
150 if (bp) { 150 if (bp) {
151 XFS_BUF_UNDONE(bp); 151 XFS_BUF_UNDONE(bp);
152 xfs_buf_delwri_dequeue(bp);
153 xfs_buf_stale(bp); 152 xfs_buf_stale(bp);
154 /* 153 /*
155 * brelse clears B_ERROR and b_error 154 * brelse clears B_ERROR and b_error
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index d03a8ee19172..5bab5980a6f9 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -162,7 +162,6 @@ xfs_trans_get_buf(xfs_trans_t *tp,
162 ASSERT(xfs_buf_islocked(bp)); 162 ASSERT(xfs_buf_islocked(bp));
163 if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) { 163 if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
164 xfs_buf_stale(bp); 164 xfs_buf_stale(bp);
165 xfs_buf_delwri_dequeue(bp);
166 XFS_BUF_DONE(bp); 165 XFS_BUF_DONE(bp);
167 } 166 }
168 167
@@ -391,7 +390,6 @@ xfs_trans_read_buf(
391 if (bp->b_error) { 390 if (bp->b_error) {
392 error = bp->b_error; 391 error = bp->b_error;
393 xfs_buf_stale(bp); 392 xfs_buf_stale(bp);
394 xfs_buf_delwri_dequeue(bp);
395 XFS_BUF_DONE(bp); 393 XFS_BUF_DONE(bp);
396 xfs_ioerror_alert("xfs_trans_read_buf", mp, 394 xfs_ioerror_alert("xfs_trans_read_buf", mp,
397 bp, blkno); 395 bp, blkno);
@@ -744,7 +742,6 @@ xfs_trans_binval(
744 * We set the stale bit in the buffer as well since we're getting 742 * We set the stale bit in the buffer as well since we're getting
745 * rid of it. 743 * rid of it.
746 */ 744 */
747 xfs_buf_delwri_dequeue(bp);
748 xfs_buf_stale(bp); 745 xfs_buf_stale(bp);
749 bip->bli_flags |= XFS_BLI_STALE; 746 bip->bli_flags |= XFS_BLI_STALE;
750 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY); 747 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);