aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-13 07:43:49 -0400
committerChristoph Hellwig <hch@lst.de>2011-07-13 07:43:49 -0400
commitcb669ca5701153a808db6627521cc8aa52fc42d1 (patch)
tree90529cad1994d11b8a21b0c2607adfb8da0b49fd /fs/xfs
parentadadbeefb34f755a3477da51035eeeec2c1fde38 (diff)
xfs: remove wrappers around b_iodone
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h4
-rw-r--r--fs/xfs/xfs_buf_item.c16
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_log.c4
-rw-r--r--fs/xfs/xfs_log_recover.c8
-rw-r--r--fs/xfs/xfs_trans_buf.c6
7 files changed, 20 insertions, 24 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index a0d97c5a3f15..888176ad5308 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1107,7 +1107,7 @@ xfs_bioerror_relse(
1107 XFS_BUF_UNDELAYWRITE(bp); 1107 XFS_BUF_UNDELAYWRITE(bp);
1108 XFS_BUF_DONE(bp); 1108 XFS_BUF_DONE(bp);
1109 XFS_BUF_STALE(bp); 1109 XFS_BUF_STALE(bp);
1110 XFS_BUF_CLR_IODONE_FUNC(bp); 1110 bp->b_iodone = NULL;
1111 if (!(fl & XBF_ASYNC)) { 1111 if (!(fl & XBF_ASYNC)) {
1112 /* 1112 /*
1113 * Mark b_error and B_ERROR _both_. 1113 * Mark b_error and B_ERROR _both_.
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index 033c152c411c..6a83b46b4bcf 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -276,10 +276,6 @@ void xfs_buf_stale(struct xfs_buf *bp);
276#define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE) 276#define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE)
277#define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE) 277#define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE)
278 278
279#define XFS_BUF_IODONE_FUNC(bp) ((bp)->b_iodone)
280#define XFS_BUF_SET_IODONE_FUNC(bp, func) ((bp)->b_iodone = (func))
281#define XFS_BUF_CLR_IODONE_FUNC(bp) ((bp)->b_iodone = NULL)
282
283#define XFS_BUF_SET_START(bp) do { } while (0) 279#define XFS_BUF_SET_START(bp) do { } while (0)
284 280
285#define XFS_BUF_PTR(bp) (xfs_caddr_t)((bp)->b_addr) 281#define XFS_BUF_PTR(bp) (xfs_caddr_t)((bp)->b_addr)
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 9eacf06932bb..88492916c3dc 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -453,7 +453,7 @@ xfs_buf_item_unpin(
453 if (bip->bli_flags & XFS_BLI_STALE_INODE) { 453 if (bip->bli_flags & XFS_BLI_STALE_INODE) {
454 xfs_buf_do_callbacks(bp); 454 xfs_buf_do_callbacks(bp);
455 bp->b_fspriv = NULL; 455 bp->b_fspriv = NULL;
456 XFS_BUF_CLR_IODONE_FUNC(bp); 456 bp->b_iodone = NULL;
457 } else { 457 } else {
458 spin_lock(&ailp->xa_lock); 458 spin_lock(&ailp->xa_lock);
459 xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip); 459 xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip);
@@ -870,8 +870,8 @@ xfs_buf_item_relse(
870 870
871 bip = bp->b_fspriv; 871 bip = bp->b_fspriv;
872 bp->b_fspriv = bip->bli_item.li_bio_list; 872 bp->b_fspriv = bip->bli_item.li_bio_list;
873 if (bp->b_fspriv == NULL && XFS_BUF_IODONE_FUNC(bp) != NULL) 873 if (bp->b_fspriv == NULL)
874 XFS_BUF_CLR_IODONE_FUNC(bp); 874 bp->b_iodone = NULL;
875 875
876 xfs_buf_rele(bp); 876 xfs_buf_rele(bp);
877 xfs_buf_item_free(bip); 877 xfs_buf_item_free(bip);
@@ -907,9 +907,9 @@ xfs_buf_attach_iodone(
907 bp->b_fspriv = lip; 907 bp->b_fspriv = lip;
908 } 908 }
909 909
910 ASSERT((XFS_BUF_IODONE_FUNC(bp) == xfs_buf_iodone_callbacks) || 910 ASSERT(bp->b_iodone == NULL ||
911 (XFS_BUF_IODONE_FUNC(bp) == NULL)); 911 bp->b_iodone == xfs_buf_iodone_callbacks);
912 XFS_BUF_SET_IODONE_FUNC(bp, xfs_buf_iodone_callbacks); 912 bp->b_iodone = xfs_buf_iodone_callbacks;
913} 913}
914 914
915/* 915/*
@@ -998,7 +998,7 @@ xfs_buf_iodone_callbacks(
998 XFS_BUF_DONE(bp); 998 XFS_BUF_DONE(bp);
999 XFS_BUF_SET_START(bp); 999 XFS_BUF_SET_START(bp);
1000 } 1000 }
1001 ASSERT(XFS_BUF_IODONE_FUNC(bp)); 1001 ASSERT(bp->b_iodone != NULL);
1002 trace_xfs_buf_item_iodone_async(bp, _RET_IP_); 1002 trace_xfs_buf_item_iodone_async(bp, _RET_IP_);
1003 xfs_buf_relse(bp); 1003 xfs_buf_relse(bp);
1004 return; 1004 return;
@@ -1018,7 +1018,7 @@ xfs_buf_iodone_callbacks(
1018do_callbacks: 1018do_callbacks:
1019 xfs_buf_do_callbacks(bp); 1019 xfs_buf_do_callbacks(bp);
1020 bp->b_fspriv = NULL; 1020 bp->b_fspriv = NULL;
1021 XFS_BUF_CLR_IODONE_FUNC(bp); 1021 bp->b_iodone = NULL;
1022 xfs_buf_ioend(bp, 0); 1022 xfs_buf_ioend(bp, 0);
1023} 1023}
1024 1024
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 34c6872b5f7b..1314c83ded1c 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2471,7 +2471,7 @@ cluster_corrupt_out:
2471 * mark the buffer as an error and call them. Otherwise 2471 * mark the buffer as an error and call them. Otherwise
2472 * mark it as stale and brelse. 2472 * mark it as stale and brelse.
2473 */ 2473 */
2474 if (XFS_BUF_IODONE_FUNC(bp)) { 2474 if (bp->b_iodone) {
2475 XFS_BUF_UNDONE(bp); 2475 XFS_BUF_UNDONE(bp);
2476 XFS_BUF_STALE(bp); 2476 XFS_BUF_STALE(bp);
2477 XFS_BUF_ERROR(bp,EIO); 2477 XFS_BUF_ERROR(bp,EIO);
@@ -2812,7 +2812,7 @@ xfs_iflush_int(
2812 xfs_buf_attach_iodone(bp, xfs_iflush_done, &iip->ili_item); 2812 xfs_buf_attach_iodone(bp, xfs_iflush_done, &iip->ili_item);
2813 2813
2814 ASSERT(bp->b_fspriv != NULL); 2814 ASSERT(bp->b_fspriv != NULL);
2815 ASSERT(XFS_BUF_IODONE_FUNC(bp) != NULL); 2815 ASSERT(bp->b_iodone != NULL);
2816 } else { 2816 } else {
2817 /* 2817 /*
2818 * We're flushing an inode which is not in the AIL and has 2818 * We're flushing an inode which is not in the AIL and has
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index a8718ed9776d..06ff8437ed8e 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1050,7 +1050,7 @@ xlog_alloc_log(xfs_mount_t *mp,
1050 bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp); 1050 bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp);
1051 if (!bp) 1051 if (!bp)
1052 goto out_free_log; 1052 goto out_free_log;
1053 XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); 1053 bp->b_iodone = xlog_iodone;
1054 ASSERT(XFS_BUF_ISBUSY(bp)); 1054 ASSERT(XFS_BUF_ISBUSY(bp));
1055 ASSERT(xfs_buf_islocked(bp)); 1055 ASSERT(xfs_buf_islocked(bp));
1056 log->l_xbuf = bp; 1056 log->l_xbuf = bp;
@@ -1084,7 +1084,7 @@ xlog_alloc_log(xfs_mount_t *mp,
1084 if (!bp) 1084 if (!bp)
1085 goto out_free_iclog; 1085 goto out_free_iclog;
1086 1086
1087 XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); 1087 bp->b_iodone = xlog_iodone;
1088 iclog->ic_bp = bp; 1088 iclog->ic_bp = bp;
1089 iclog->ic_data = bp->b_addr; 1089 iclog->ic_data = bp->b_addr;
1090#ifdef DEBUG 1090#ifdef DEBUG
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 40c9742aa478..8fe4206de057 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -371,7 +371,7 @@ xlog_recover_iodone(
371 xfs_force_shutdown(bp->b_target->bt_mount, 371 xfs_force_shutdown(bp->b_target->bt_mount,
372 SHUTDOWN_META_IO_ERROR); 372 SHUTDOWN_META_IO_ERROR);
373 } 373 }
374 XFS_BUF_CLR_IODONE_FUNC(bp); 374 bp->b_iodone = NULL;
375 xfs_buf_ioend(bp, 0); 375 xfs_buf_ioend(bp, 0);
376} 376}
377 377
@@ -2178,7 +2178,7 @@ xlog_recover_buffer_pass2(
2178 error = xfs_bwrite(mp, bp); 2178 error = xfs_bwrite(mp, bp);
2179 } else { 2179 } else {
2180 ASSERT(bp->b_target->bt_mount == mp); 2180 ASSERT(bp->b_target->bt_mount == mp);
2181 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); 2181 bp->b_iodone = xlog_recover_iodone;
2182 xfs_bdwrite(mp, bp); 2182 xfs_bdwrite(mp, bp);
2183 } 2183 }
2184 2184
@@ -2438,7 +2438,7 @@ xlog_recover_inode_pass2(
2438 2438
2439write_inode_buffer: 2439write_inode_buffer:
2440 ASSERT(bp->b_target->bt_mount == mp); 2440 ASSERT(bp->b_target->bt_mount == mp);
2441 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); 2441 bp->b_iodone = xlog_recover_iodone;
2442 xfs_bdwrite(mp, bp); 2442 xfs_bdwrite(mp, bp);
2443error: 2443error:
2444 if (need_free) 2444 if (need_free)
@@ -2560,7 +2560,7 @@ xlog_recover_dquot_pass2(
2560 2560
2561 ASSERT(dq_f->qlf_size == 2); 2561 ASSERT(dq_f->qlf_size == 2);
2562 ASSERT(bp->b_target->bt_mount == mp); 2562 ASSERT(bp->b_target->bt_mount == mp);
2563 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); 2563 bp->b_iodone = xlog_recover_iodone;
2564 xfs_bdwrite(mp, bp); 2564 xfs_bdwrite(mp, bp);
2565 2565
2566 return (0); 2566 return (0);
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index f910e51444a3..15584fc3ed7d 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -635,8 +635,8 @@ xfs_trans_log_buf(xfs_trans_t *tp,
635 ASSERT(bp->b_transp == tp); 635 ASSERT(bp->b_transp == tp);
636 ASSERT(bip != NULL); 636 ASSERT(bip != NULL);
637 ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp))); 637 ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp)));
638 ASSERT((XFS_BUF_IODONE_FUNC(bp) == NULL) || 638 ASSERT(bp->b_iodone == NULL ||
639 (XFS_BUF_IODONE_FUNC(bp) == xfs_buf_iodone_callbacks)); 639 bp->b_iodone == xfs_buf_iodone_callbacks);
640 640
641 /* 641 /*
642 * Mark the buffer as needing to be written out eventually, 642 * Mark the buffer as needing to be written out eventually,
@@ -652,7 +652,7 @@ xfs_trans_log_buf(xfs_trans_t *tp,
652 XFS_BUF_DONE(bp); 652 XFS_BUF_DONE(bp);
653 653
654 ASSERT(atomic_read(&bip->bli_refcount) > 0); 654 ASSERT(atomic_read(&bip->bli_refcount) > 0);
655 XFS_BUF_SET_IODONE_FUNC(bp, xfs_buf_iodone_callbacks); 655 bp->b_iodone = xfs_buf_iodone_callbacks;
656 bip->bli_item.li_cb = xfs_buf_iodone; 656 bip->bli_item.li_cb = xfs_buf_iodone;
657 657
658 trace_xfs_trans_log_buf(bip); 658 trace_xfs_trans_log_buf(bip);