/* * The BUI has been either committed or aborted if the transaction has been * cancelled. If the transaction was cancelled, an BUD isn't going to be * constructed and thus we free the BUI here directly. */ STATIC void xfs_bui_item_unlock( struct xfs_log_item *lip) { if (lip->li_flags & XFS_LI_ABORTED) xfs_bui_item_free(BUI_ITEM(lip)); }
/* * Freeing the BUI requires that we remove it from the AIL if it has already * been placed there. However, the BUI may not yet have been placed in the AIL * when called by xfs_bui_release() from BUD 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 BUI. */ void xfs_bui_release( struct xfs_bui_log_item *buip) { if (atomic_dec_and_test(&buip->bui_refcount)) { xfs_trans_ail_remove(&buip->bui_item, SHUTDOWN_LOG_IO_ERROR); xfs_bui_item_free(buip); } }