mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
xfs: improve the xfs_buf_ioend_fail calling convention
Move setting the ASYNC flag into xfs_buf_ioend_fail, assert that the buffer is locked as expected, and drop the confusing _ioend in the name. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
cc9af5e461
commit
4c8b46d832
|
|
@ -1192,17 +1192,18 @@ xfs_buf_ioerror_alert(
|
|||
}
|
||||
|
||||
/*
|
||||
* To simulate an I/O failure, the buffer must be locked and held with at least
|
||||
* two references.
|
||||
* Fail a locked and referenced buffer outside the I/O path.
|
||||
*
|
||||
* The buf item reference is dropped via ioend processing. The second reference
|
||||
* is owned by the caller and is dropped on I/O completion if the buffer is
|
||||
* XBF_ASYNC.
|
||||
* The caller transfers a reference which will be released after processing the
|
||||
* error.
|
||||
*/
|
||||
void
|
||||
xfs_buf_ioend_fail(
|
||||
xfs_buf_fail(
|
||||
struct xfs_buf *bp)
|
||||
{
|
||||
ASSERT(xfs_buf_islocked(bp));
|
||||
|
||||
bp->b_flags |= XBF_ASYNC;
|
||||
bp->b_flags &= ~XBF_DONE;
|
||||
xfs_buf_stale(bp);
|
||||
xfs_buf_ioerror(bp, -EIO);
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ extern void __xfs_buf_ioerror(struct xfs_buf *bp, int error,
|
|||
xfs_failaddr_t failaddr);
|
||||
#define xfs_buf_ioerror(bp, err) __xfs_buf_ioerror((bp), (err), __this_address)
|
||||
extern void xfs_buf_ioerror_alert(struct xfs_buf *bp, xfs_failaddr_t fa);
|
||||
void xfs_buf_ioend_fail(struct xfs_buf *);
|
||||
void xfs_buf_fail(struct xfs_buf *bp);
|
||||
void __xfs_buf_mark_corrupt(struct xfs_buf *bp, xfs_failaddr_t fa);
|
||||
#define xfs_buf_mark_corrupt(bp) __xfs_buf_mark_corrupt((bp), __this_address)
|
||||
|
||||
|
|
|
|||
|
|
@ -549,8 +549,7 @@ xfs_buf_item_unpin(
|
|||
* wait for the lock and then run the IO failure completion.
|
||||
*/
|
||||
xfs_buf_lock(bp);
|
||||
bp->b_flags |= XBF_ASYNC;
|
||||
xfs_buf_ioend_fail(bp);
|
||||
xfs_buf_fail(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2646,8 +2646,7 @@ xfs_iflush_cluster(
|
|||
* inode cluster buffers.
|
||||
*/
|
||||
xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
|
||||
bp->b_flags |= XBF_ASYNC;
|
||||
xfs_buf_ioend_fail(bp);
|
||||
xfs_buf_fail(bp);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user