cmn_err(CE_WARN, "XFS: AIL initialisation failed: error %d", error);
goto error;
}
+ mp->m_log->l_ailp = mp->m_ail;
/*
* skip log recovery on a norecovery mount. pretend it all
spin_lock(&log->l_icloglock);
if (((log->l_covered_state == XLOG_STATE_COVER_NEED) ||
(log->l_covered_state == XLOG_STATE_COVER_NEED2))
- && !xfs_trans_ail_tail(mp->m_ail)
+ && !xfs_trans_ail_tail(log->l_ailp)
&& xlog_iclogs_empty(log)) {
if (log->l_covered_state == XLOG_STATE_COVER_NEED)
log->l_covered_state = XLOG_STATE_COVER_DONE;
efip->efi_next_extent = efi_formatp->efi_nextents;
efip->efi_flags |= XFS_EFI_COMMITTED;
- spin_lock(&mp->m_ail->xa_lock);
+ spin_lock(&log->l_ailp->xa_lock);
/*
* xfs_trans_update_ail() drops the AIL lock.
*/
xfs_log_item_t *lip;
__uint64_t efi_id;
struct xfs_ail_cursor cur;
+ struct xfs_ail *ailp;
if (pass == XLOG_RECOVER_PASS1) {
return;
* in the AIL.
*/
mp = log->l_mp;
- spin_lock(&mp->m_ail->xa_lock);
- lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0);
+ ailp = log->l_ailp;
+ spin_lock(&ailp->xa_lock);
+ lip = xfs_trans_ail_cursor_first(ailp, &cur, 0);
while (lip != NULL) {
if (lip->li_type == XFS_LI_EFI) {
efip = (xfs_efi_log_item_t *)lip;
*/
xfs_trans_delete_ail(mp, lip);
xfs_efi_item_free(efip);
- spin_lock(&mp->m_ail->xa_lock);
+ spin_lock(&ailp->xa_lock);
break;
}
}
- lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
+ lip = xfs_trans_ail_cursor_next(ailp, &cur);
}
- xfs_trans_ail_cursor_done(mp->m_ail, &cur);
- spin_unlock(&mp->m_ail->xa_lock);
+ xfs_trans_ail_cursor_done(ailp, &cur);
+ spin_unlock(&ailp->xa_lock);
}
/*
{
xfs_log_item_t *lip;
xfs_efi_log_item_t *efip;
- xfs_mount_t *mp;
int error = 0;
struct xfs_ail_cursor cur;
+ struct xfs_ail *ailp;
- mp = log->l_mp;
- spin_lock(&mp->m_ail->xa_lock);
-
- lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0);
+ ailp = log->l_ailp;
+ spin_lock(&ailp->xa_lock);
+ lip = xfs_trans_ail_cursor_first(ailp, &cur, 0);
while (lip != NULL) {
/*
* We're done when we see something other than an EFI.
*/
if (lip->li_type != XFS_LI_EFI) {
#ifdef DEBUG
- for (; lip;
- lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur))
+ for (; lip; lip = xfs_trans_ail_cursor_next(ailp, &cur))
ASSERT(lip->li_type != XFS_LI_EFI);
#endif
break;
*/
efip = (xfs_efi_log_item_t *)lip;
if (efip->efi_flags & XFS_EFI_RECOVERED) {
- lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
+ lip = xfs_trans_ail_cursor_next(ailp, &cur);
continue;
}
- spin_unlock(&mp->m_ail->xa_lock);
- error = xlog_recover_process_efi(mp, efip);
- spin_lock(&mp->m_ail->xa_lock);
+ spin_unlock(&ailp->xa_lock);
+ error = xlog_recover_process_efi(log->l_mp, efip);
+ spin_lock(&ailp->xa_lock);
if (error)
goto out;
- lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
+ lip = xfs_trans_ail_cursor_next(ailp, &cur);
}
out:
- xfs_trans_ail_cursor_done(mp->m_ail, &cur);
- spin_unlock(&mp->m_ail->xa_lock);
+ xfs_trans_ail_cursor_done(ailp, &cur);
+ spin_unlock(&ailp->xa_lock);
return error;
}