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>
This commit is contained in:
parent
adadbeefb3
commit
cb669ca570
@ -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_.
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user