xfs: remove wrappers around b_iodone
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Jul 2011 11:43:49 +0000 (13:43 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 13 Jul 2011 11:43:49 +0000 (13:43 +0200)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_trans_buf.c

index a0d97c5a3f1526f4c338799bc78b938aea107036..888176ad530871f162b7e3302ae66471ca2c5281 100644 (file)
@@ -1107,7 +1107,7 @@ xfs_bioerror_relse(
        XFS_BUF_UNDELAYWRITE(bp);
        XFS_BUF_DONE(bp);
        XFS_BUF_STALE(bp);
-       XFS_BUF_CLR_IODONE_FUNC(bp);
+       bp->b_iodone = NULL;
        if (!(fl & XBF_ASYNC)) {
                /*
                 * Mark b_error and B_ERROR _both_.
index 033c152c411c2c25ad389a1ef28bb6c1a1853a6a..6a83b46b4bcf91bdc90b235736ff600bed0dd883 100644 (file)
@@ -276,10 +276,6 @@ void xfs_buf_stale(struct xfs_buf *bp);
 #define XFS_BUF_UNWRITE(bp)    ((bp)->b_flags &= ~XBF_WRITE)
 #define XFS_BUF_ISWRITE(bp)    ((bp)->b_flags & XBF_WRITE)
 
-#define XFS_BUF_IODONE_FUNC(bp)                        ((bp)->b_iodone)
-#define XFS_BUF_SET_IODONE_FUNC(bp, func)      ((bp)->b_iodone = (func))
-#define XFS_BUF_CLR_IODONE_FUNC(bp)            ((bp)->b_iodone = NULL)
-
 #define XFS_BUF_SET_START(bp)                  do { } while (0)
 
 #define XFS_BUF_PTR(bp)                        (xfs_caddr_t)((bp)->b_addr)
index 9eacf06932bb1a405f24ae1150ecd2c5b0c76fe0..88492916c3dc0ed9b3bdd1aead549c8b00d87bbc 100644 (file)
@@ -453,7 +453,7 @@ xfs_buf_item_unpin(
                if (bip->bli_flags & XFS_BLI_STALE_INODE) {
                        xfs_buf_do_callbacks(bp);
                        bp->b_fspriv = NULL;
-                       XFS_BUF_CLR_IODONE_FUNC(bp);
+                       bp->b_iodone = NULL;
                } else {
                        spin_lock(&ailp->xa_lock);
                        xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip);
@@ -870,8 +870,8 @@ xfs_buf_item_relse(
 
        bip = bp->b_fspriv;
        bp->b_fspriv = bip->bli_item.li_bio_list;
-       if (bp->b_fspriv == NULL && XFS_BUF_IODONE_FUNC(bp) != NULL)
-               XFS_BUF_CLR_IODONE_FUNC(bp);
+       if (bp->b_fspriv == NULL)
+               bp->b_iodone = NULL;
 
        xfs_buf_rele(bp);
        xfs_buf_item_free(bip);
@@ -907,9 +907,9 @@ xfs_buf_attach_iodone(
                bp->b_fspriv = lip;
        }
 
-       ASSERT((XFS_BUF_IODONE_FUNC(bp) == xfs_buf_iodone_callbacks) ||
-              (XFS_BUF_IODONE_FUNC(bp) == NULL));
-       XFS_BUF_SET_IODONE_FUNC(bp, xfs_buf_iodone_callbacks);
+       ASSERT(bp->b_iodone == NULL ||
+              bp->b_iodone == xfs_buf_iodone_callbacks);
+       bp->b_iodone = xfs_buf_iodone_callbacks;
 }
 
 /*
@@ -998,7 +998,7 @@ xfs_buf_iodone_callbacks(
                        XFS_BUF_DONE(bp);
                        XFS_BUF_SET_START(bp);
                }
-               ASSERT(XFS_BUF_IODONE_FUNC(bp));
+               ASSERT(bp->b_iodone != NULL);
                trace_xfs_buf_item_iodone_async(bp, _RET_IP_);
                xfs_buf_relse(bp);
                return;
@@ -1018,7 +1018,7 @@ xfs_buf_iodone_callbacks(
 do_callbacks:
        xfs_buf_do_callbacks(bp);
        bp->b_fspriv = NULL;
-       XFS_BUF_CLR_IODONE_FUNC(bp);
+       bp->b_iodone = NULL;
        xfs_buf_ioend(bp, 0);
 }
 
index 34c6872b5f7b8c972bc12549722da40c9d6c6eb9..1314c83ded1cdd93b0aecf6c6835f9154488d217 100644 (file)
@@ -2471,7 +2471,7 @@ cluster_corrupt_out:
                 * mark the buffer as an error and call them.  Otherwise
                 * mark it as stale and brelse.
                 */
-               if (XFS_BUF_IODONE_FUNC(bp)) {
+               if (bp->b_iodone) {
                        XFS_BUF_UNDONE(bp);
                        XFS_BUF_STALE(bp);
                        XFS_BUF_ERROR(bp,EIO);
@@ -2812,7 +2812,7 @@ xfs_iflush_int(
                xfs_buf_attach_iodone(bp, xfs_iflush_done, &iip->ili_item);
 
                ASSERT(bp->b_fspriv != NULL);
-               ASSERT(XFS_BUF_IODONE_FUNC(bp) != NULL);
+               ASSERT(bp->b_iodone != NULL);
        } else {
                /*
                 * We're flushing an inode which is not in the AIL and has
index a8718ed9776df78800791e70d7921d38f32894e1..06ff8437ed8e4cab29048de38dfa15f165739b83 100644 (file)
@@ -1050,7 +1050,7 @@ xlog_alloc_log(xfs_mount_t        *mp,
        bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp);
        if (!bp)
                goto out_free_log;
-       XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone);
+       bp->b_iodone = xlog_iodone;
        ASSERT(XFS_BUF_ISBUSY(bp));
        ASSERT(xfs_buf_islocked(bp));
        log->l_xbuf = bp;
@@ -1084,7 +1084,7 @@ xlog_alloc_log(xfs_mount_t        *mp,
                if (!bp)
                        goto out_free_iclog;
 
-               XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone);
+               bp->b_iodone = xlog_iodone;
                iclog->ic_bp = bp;
                iclog->ic_data = bp->b_addr;
 #ifdef DEBUG
index 40c9742aa478dc42561626330f4da1a4fd47e3d7..8fe4206de0579e3bd8fede02cc0aa6202f02ecc9 100644 (file)
@@ -371,7 +371,7 @@ xlog_recover_iodone(
                xfs_force_shutdown(bp->b_target->bt_mount,
                                        SHUTDOWN_META_IO_ERROR);
        }
-       XFS_BUF_CLR_IODONE_FUNC(bp);
+       bp->b_iodone = NULL;
        xfs_buf_ioend(bp, 0);
 }
 
@@ -2178,7 +2178,7 @@ xlog_recover_buffer_pass2(
                error = xfs_bwrite(mp, bp);
        } else {
                ASSERT(bp->b_target->bt_mount == mp);
-               XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
+               bp->b_iodone = xlog_recover_iodone;
                xfs_bdwrite(mp, bp);
        }
 
@@ -2438,7 +2438,7 @@ xlog_recover_inode_pass2(
 
 write_inode_buffer:
        ASSERT(bp->b_target->bt_mount == mp);
-       XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
+       bp->b_iodone = xlog_recover_iodone;
        xfs_bdwrite(mp, bp);
 error:
        if (need_free)
@@ -2560,7 +2560,7 @@ xlog_recover_dquot_pass2(
 
        ASSERT(dq_f->qlf_size == 2);
        ASSERT(bp->b_target->bt_mount == mp);
-       XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
+       bp->b_iodone = xlog_recover_iodone;
        xfs_bdwrite(mp, bp);
 
        return (0);
index f910e51444a30cdc491135066b83d3f4aa6da2d8..15584fc3ed7d5d87a1627e9156f7694c02f522c9 100644 (file)
@@ -635,8 +635,8 @@ xfs_trans_log_buf(xfs_trans_t       *tp,
        ASSERT(bp->b_transp == tp);
        ASSERT(bip != NULL);
        ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp)));
-       ASSERT((XFS_BUF_IODONE_FUNC(bp) == NULL) ||
-              (XFS_BUF_IODONE_FUNC(bp) == xfs_buf_iodone_callbacks));
+       ASSERT(bp->b_iodone == NULL ||
+              bp->b_iodone == xfs_buf_iodone_callbacks);
 
        /*
         * Mark the buffer as needing to be written out eventually,
@@ -652,7 +652,7 @@ xfs_trans_log_buf(xfs_trans_t       *tp,
        XFS_BUF_DONE(bp);
 
        ASSERT(atomic_read(&bip->bli_refcount) > 0);
-       XFS_BUF_SET_IODONE_FUNC(bp, xfs_buf_iodone_callbacks);
+       bp->b_iodone = xfs_buf_iodone_callbacks;
        bip->bli_item.li_cb = xfs_buf_iodone;
 
        trace_xfs_trans_log_buf(bip);