/* Same as xfs_bioerror, except that we are releasing the buffer here ourselves, and avoiding the biodone call. This is meant for userdata errors; metadata bufs come with iodone functions attached, so that we can track down errors.  */
int xfs_bioerror_relse(xfs_buf_t *bp)
/* Same as xfs_bioerror, except that we are releasing the buffer here ourselves, and avoiding the biodone call. This is meant for userdata errors; metadata bufs come with iodone functions attached, so that we can track down errors.  */
int xfs_bioerror_relse(xfs_buf_t *bp)
{
	int64_t fl;
	ASSERT(XFS_BUF_IODONE_FUNC(bp) != xfs_buf_iodone_callbacks);
	ASSERT(XFS_BUF_IODONE_FUNC(bp) != xlog_iodone);
	fl = XFS_BUF_BFLAGS(bp);
	XFS_BUF_UNREAD(bp);
	XFS_BUF_UNDELAYWRITE(bp);
	XFS_BUF_DONE(bp);
	XFS_BUF_STALE(bp);
	XFS_BUF_CLR_IODONE_FUNC(bp);
	XFS_BUF_CLR_BDSTRAT_FUNC(bp);
	if (!(fl & XFS_B_ASYNC)) {
		XFS_BUF_ERROR(bp, EIO);
		XFS_BUF_FINISH_IOWAIT(bp);
	} else {
		xfs_buf_relse(bp);
	}
	return (EIO);
}