提交 23fb5a93 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: refactor xfs_buf_ioend

Move the log recovery I/O completion handling entirely into the log
recovery code, and re-arrange the normal I/O completion handler flow
to prepare to lifting more logic into common code in the next commits.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 76b2d323
...@@ -1197,33 +1197,26 @@ xfs_buf_ioend( ...@@ -1197,33 +1197,26 @@ xfs_buf_ioend(
if (!bp->b_error) if (!bp->b_error)
bp->b_flags |= XBF_DONE; bp->b_flags |= XBF_DONE;
xfs_buf_ioend_finish(bp); xfs_buf_ioend_finish(bp);
return; } else if (bp->b_flags & _XBF_LOGRECOVERY) {
} /*
* If this is a log recovery buffer, we aren't doing
if (!bp->b_error) { * transactional I/O yet so we need to let the log recovery code
bp->b_flags &= ~XBF_WRITE_FAIL; * handle I/O completions:
bp->b_flags |= XBF_DONE; */
}
/*
* If this is a log recovery buffer, we aren't doing transactional IO
* yet so we need to let it handle IO completions.
*/
if (bp->b_flags & _XBF_LOGRECOVERY) {
xlog_recover_iodone(bp); xlog_recover_iodone(bp);
return; } else {
} if (!bp->b_error) {
bp->b_flags &= ~XBF_WRITE_FAIL;
if (bp->b_flags & _XBF_INODES) { bp->b_flags |= XBF_DONE;
xfs_buf_inode_iodone(bp); }
return;
}
if (bp->b_flags & _XBF_DQUOTS) { if (bp->b_flags & _XBF_INODES)
xfs_buf_dquot_iodone(bp); xfs_buf_inode_iodone(bp);
return; else if (bp->b_flags & _XBF_DQUOTS)
xfs_buf_dquot_iodone(bp);
else
xfs_buf_iodone(bp);
} }
xfs_buf_iodone(bp);
} }
static void static void
......
...@@ -269,15 +269,15 @@ void ...@@ -269,15 +269,15 @@ void
xlog_recover_iodone( xlog_recover_iodone(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
if (bp->b_error) { if (!bp->b_error) {
bp->b_flags |= XBF_DONE;
} else if (!XFS_FORCED_SHUTDOWN(bp->b_mount)) {
/* /*
* We're not going to bother about retrying * We're not going to bother about retrying this during
* this during recovery. One strike! * recovery. One strike!
*/ */
if (!XFS_FORCED_SHUTDOWN(bp->b_mount)) { xfs_buf_ioerror_alert(bp, __this_address);
xfs_buf_ioerror_alert(bp, __this_address); xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR);
xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR);
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册