-/*
- * Freeing the efi requires that we remove it from the AIL if it has already
- * been placed there. However, the EFI may not yet have been placed in the AIL
- * when called by xfs_efi_release() from EFD processing due to the ordering of
- * committed vs unpin operations in bulk insert operations. Hence the reference
- * count to ensure only the last caller frees the EFI.
- */
-STATIC void
-__xfs_efi_release(
- struct xfs_efi_log_item *efip)
-{
- struct xfs_ail *ailp = efip->efi_item.li_ailp;
-
- if (atomic_dec_and_test(&efip->efi_refcount)) {
- spin_lock(&ailp->xa_lock);
- /*
- * We don't know whether the EFI made it to the AIL. Remove it
- * if so. Note that xfs_trans_ail_delete() drops the AIL lock.
- */
- if (efip->efi_item.li_flags & XFS_LI_IN_AIL)
- xfs_trans_ail_delete(ailp, &efip->efi_item,
- SHUTDOWN_LOG_IO_ERROR);
- else
- spin_unlock(&ailp->xa_lock);
- xfs_efi_item_free(efip);
- }
-}
-