示例#1
0
STATIC uint
xfs_buf_item_push(
    struct xfs_log_item	*lip,
    struct list_head	*buffer_list)
{
    struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
    struct xfs_buf		*bp = bip->bli_buf;
    uint			rval = XFS_ITEM_SUCCESS;

    if (xfs_buf_ispinned(bp))
        return XFS_ITEM_PINNED;
    if (!xfs_buf_trylock(bp)) {
        /*
         * If we have just raced with a buffer being pinned and it has
         * been marked stale, we could end up stalling until someone else
         * issues a log force to unpin the stale buffer. Check for the
         * race condition here so xfsaild recognizes the buffer is pinned
         * and queues a log force to move it along.
         */
        if (xfs_buf_ispinned(bp))
            return XFS_ITEM_PINNED;
        return XFS_ITEM_LOCKED;
    }

    ASSERT(!(bip->bli_flags & XFS_BLI_STALE));

    trace_xfs_buf_item_push(bip);

    if (!xfs_buf_delwri_queue(bp, buffer_list))
        rval = XFS_ITEM_FLUSHING;
    xfs_buf_unlock(bp);
    return rval;
}
STATIC uint
xfs_buf_item_push(
	struct xfs_log_item	*lip,
	struct list_head	*buffer_list)
{
	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
	struct xfs_buf		*bp = bip->bli_buf;
	uint			rval = XFS_ITEM_SUCCESS;

	if (xfs_buf_ispinned(bp))
		return XFS_ITEM_PINNED;
	if (!xfs_buf_trylock(bp)) {
		/*
		 * If we have just raced with a buffer being pinned and it has
		 * been marked stale, we could end up stalling until someone else
		 * issues a log force to unpin the stale buffer. Check for the
		 * race condition here so xfsaild recognizes the buffer is pinned
		 * and queues a log force to move it along.
		 */
		if (xfs_buf_ispinned(bp))
			return XFS_ITEM_PINNED;
		return XFS_ITEM_LOCKED;
	}

	ASSERT(!(bip->bli_flags & XFS_BLI_STALE));

	trace_xfs_buf_item_push(bip);

	/* has a previous flush failed due to IO errors? */
	if ((bp->b_flags & XBF_WRITE_FAIL) &&
	    ___ratelimit(&xfs_buf_write_fail_rl_state, "XFS:")) {
		xfs_warn(bp->b_target->bt_mount,
"Detected failing async write on buffer block 0x%llx. Retrying async write.\n",
			 (long long)bp->b_bn);
	}

	if (!xfs_buf_delwri_queue(bp, buffer_list))
		rval = XFS_ITEM_FLUSHING;
	xfs_buf_unlock(bp);
	return rval;
}
示例#3
0
STATIC uint
xfs_buf_item_push(
	struct xfs_log_item	*lip,
	struct list_head	*buffer_list)
{
	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
	struct xfs_buf		*bp = bip->bli_buf;
	uint			rval = XFS_ITEM_SUCCESS;

	if (xfs_buf_ispinned(bp))
		return XFS_ITEM_PINNED;
	if (!xfs_buf_trylock(bp))
		return XFS_ITEM_LOCKED;

	ASSERT(!(bip->bli_flags & XFS_BLI_STALE));

	trace_xfs_buf_item_push(bip);

	if (!xfs_buf_delwri_queue(bp, buffer_list))
		rval = XFS_ITEM_FLUSHING;
	xfs_buf_unlock(bp);
	return rval;
}