/* While EFIs cannot really be pinned, the unpin operation is the last place at which the EFI is manipulated during a transaction. Here we coordinate with xfs_efi_cancel() to determine who gets to free the EFI.  */
STATIC void xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
/* While EFIs cannot really be pinned, the unpin operation is the last place at which the EFI is manipulated during a transaction. Here we coordinate with xfs_efi_cancel() to determine who gets to free the EFI.  */
STATIC void xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
{
	struct xfs_ail		*ailp = efip->efi_item.li_ailp;
	spin_lock(&ailp->xa_lock);
	if (efip->efi_flags & XFS_EFI_CANCELED) {
		xfs_trans_ail_delete(ailp, (xfs_log_item_t *)efip);
		xfs_efi_item_free(efip);
	} else {
		efip->efi_flags |= XFS_EFI_COMMITTED;
		spin_unlock(&ailp->xa_lock);
	}
}