提交 b0388bf1 编写于 作者: D Dave Chinner 提交者: Dave Chinner

xfs: remove XBF_DONE flag wrapper macros

They only set/clear/check a flag, no need for obfuscating this
with a macro.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 36f90b0a
...@@ -650,7 +650,7 @@ xfs_buf_read_map( ...@@ -650,7 +650,7 @@ xfs_buf_read_map(
if (bp) { if (bp) {
trace_xfs_buf_read(bp, flags, _RET_IP_); trace_xfs_buf_read(bp, flags, _RET_IP_);
if (!XFS_BUF_ISDONE(bp)) { if (!(bp->b_flags & XBF_DONE)) {
XFS_STATS_INC(target->bt_mount, xb_get_read); XFS_STATS_INC(target->bt_mount, xb_get_read);
bp->b_ops = ops; bp->b_ops = ops;
_xfs_buf_read(bp, flags); _xfs_buf_read(bp, flags);
......
...@@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp); ...@@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp);
#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE)
#define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE)
#define XFS_BUF_DONE(bp) ((bp)->b_flags |= XBF_DONE)
#define XFS_BUF_UNDONE(bp) ((bp)->b_flags &= ~XBF_DONE)
#define XFS_BUF_ISDONE(bp) ((bp)->b_flags & XBF_DONE)
#define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC) #define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC)
#define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC) #define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC)
#define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC) #define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC)
......
...@@ -493,7 +493,7 @@ xfs_buf_item_unpin( ...@@ -493,7 +493,7 @@ xfs_buf_item_unpin(
xfs_buf_hold(bp); xfs_buf_hold(bp);
bp->b_flags |= XBF_ASYNC; bp->b_flags |= XBF_ASYNC;
xfs_buf_ioerror(bp, -EIO); xfs_buf_ioerror(bp, -EIO);
XFS_BUF_UNDONE(bp); bp->b_flags &= ~XBF_DONE;
xfs_buf_stale(bp); xfs_buf_stale(bp);
xfs_buf_ioend(bp); xfs_buf_ioend(bp);
} }
...@@ -1067,7 +1067,7 @@ xfs_buf_iodone_callbacks( ...@@ -1067,7 +1067,7 @@ xfs_buf_iodone_callbacks(
*/ */
if (XFS_FORCED_SHUTDOWN(mp)) { if (XFS_FORCED_SHUTDOWN(mp)) {
xfs_buf_stale(bp); xfs_buf_stale(bp);
XFS_BUF_DONE(bp); bp->b_flags |= XBF_DONE;
trace_xfs_buf_item_iodone(bp, _RET_IP_); trace_xfs_buf_item_iodone(bp, _RET_IP_);
goto do_callbacks; goto do_callbacks;
} }
...@@ -1113,7 +1113,7 @@ xfs_buf_iodone_callbacks( ...@@ -1113,7 +1113,7 @@ xfs_buf_iodone_callbacks(
* sure to return the error to the caller of xfs_bwrite(). * sure to return the error to the caller of xfs_bwrite().
*/ */
xfs_buf_stale(bp); xfs_buf_stale(bp);
XFS_BUF_DONE(bp); bp->b_flags |= XBF_DONE;
trace_xfs_buf_error_relse(bp, _RET_IP_); trace_xfs_buf_error_relse(bp, _RET_IP_);
......
...@@ -3313,7 +3313,7 @@ xfs_iflush_cluster( ...@@ -3313,7 +3313,7 @@ xfs_iflush_cluster(
* mark it as stale and brelse. * mark it as stale and brelse.
*/ */
if (bp->b_iodone) { if (bp->b_iodone) {
XFS_BUF_UNDONE(bp); bp->b_flags &= ~XBF_DONE;
xfs_buf_stale(bp); xfs_buf_stale(bp);
xfs_buf_ioerror(bp, -EIO); xfs_buf_ioerror(bp, -EIO);
xfs_buf_ioend(bp); xfs_buf_ioend(bp);
......
...@@ -3979,7 +3979,7 @@ xfs_log_force_umount( ...@@ -3979,7 +3979,7 @@ xfs_log_force_umount(
log->l_flags & XLOG_ACTIVE_RECOVERY) { log->l_flags & XLOG_ACTIVE_RECOVERY) {
mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN;
if (mp->m_sb_bp) if (mp->m_sb_bp)
XFS_BUF_DONE(mp->m_sb_bp); mp->m_sb_bp->b_flags |= XBF_DONE;
return 0; return 0;
} }
...@@ -4009,7 +4009,7 @@ xfs_log_force_umount( ...@@ -4009,7 +4009,7 @@ xfs_log_force_umount(
spin_lock(&log->l_icloglock); spin_lock(&log->l_icloglock);
mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN;
if (mp->m_sb_bp) if (mp->m_sb_bp)
XFS_BUF_DONE(mp->m_sb_bp); mp->m_sb_bp->b_flags |= XBF_DONE;
/* /*
* Mark the log and the iclogs with IO error flags to prevent any * Mark the log and the iclogs with IO error flags to prevent any
......
...@@ -4926,7 +4926,7 @@ xlog_do_recover( ...@@ -4926,7 +4926,7 @@ xlog_do_recover(
* updates, re-read in the superblock and reverify it. * updates, re-read in the superblock and reverify it.
*/ */
bp = xfs_getsb(log->l_mp, 0); bp = xfs_getsb(log->l_mp, 0);
XFS_BUF_UNDONE(bp); bp->b_flags &= ~XBF_DONE;
ASSERT(!(XFS_BUF_ISWRITE(bp))); ASSERT(!(XFS_BUF_ISWRITE(bp)));
XFS_BUF_READ(bp); XFS_BUF_READ(bp);
XFS_BUF_UNASYNC(bp); XFS_BUF_UNASYNC(bp);
......
...@@ -1284,7 +1284,7 @@ xfs_getsb( ...@@ -1284,7 +1284,7 @@ xfs_getsb(
} }
xfs_buf_hold(bp); xfs_buf_hold(bp);
ASSERT(XFS_BUF_ISDONE(bp)); ASSERT(bp->b_flags & XBF_DONE);
return bp; return bp;
} }
......
...@@ -155,7 +155,7 @@ xfs_trans_get_buf_map( ...@@ -155,7 +155,7 @@ xfs_trans_get_buf_map(
ASSERT(xfs_buf_islocked(bp)); ASSERT(xfs_buf_islocked(bp));
if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) { if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
xfs_buf_stale(bp); xfs_buf_stale(bp);
XFS_BUF_DONE(bp); bp->b_flags |= XBF_DONE;
} }
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
...@@ -518,7 +518,7 @@ xfs_trans_log_buf(xfs_trans_t *tp, ...@@ -518,7 +518,7 @@ xfs_trans_log_buf(xfs_trans_t *tp,
* inside the b_bdstrat callback so that this won't get written to * inside the b_bdstrat callback so that this won't get written to
* disk. * disk.
*/ */
XFS_BUF_DONE(bp); bp->b_flags |= XBF_DONE;
ASSERT(atomic_read(&bip->bli_refcount) > 0); ASSERT(atomic_read(&bip->bli_refcount) > 0);
bp->b_iodone = xfs_buf_iodone_callbacks; bp->b_iodone = xfs_buf_iodone_callbacks;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册