/* This is called to attempt to lock the buffer associated with this buf log item. Don't sleep on the buffer lock. If we can't get the lock right away, return 0. If we can get the lock, pull the buffer from the free list, mark it busy, and return 1.  */
STATIC uint xfs_buf_item_trylock(xfs_buf_log_item_t *bip)
/* This is called to attempt to lock the buffer associated with this buf log item. Don't sleep on the buffer lock. If we can't get the lock right away, return 0. If we can get the lock, pull the buffer from the free list, mark it busy, and return 1.  */
STATIC uint xfs_buf_item_trylock(xfs_buf_log_item_t *bip)
{
	xfs_buf_t	*bp;
	bp = bip->bli_buf;
	if (XFS_BUF_ISPINNED(bp)) {
		return XFS_ITEM_PINNED;
	}
	if (!XFS_BUF_CPSEMA(bp)) {
		return XFS_ITEM_LOCKED;
	}
	XFS_BUF_HOLD(bp);
	ASSERT(!(bip->bli_flags & XFS_BLI_STALE));
	trace_xfs_buf_item_trylock(bip);
	return XFS_ITEM_SUCCESS;
}