Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7e8f268 authored by David Chinner's avatar David Chinner Committed by Lachlan McIlroy
Browse files

[XFS] Move the AIL lock into the struct xfs_ail



Bring the ail lock inside the struct xfs_ail. This means the AIL can be
entirely manipulated via the struct xfs_ail rather than needing both the
struct xfs_mount and the struct xfs_ail.

SGI-PV: 988143

SGI-Modid: xfs-linux-melb:xfs-kern:32350a

Signed-off-by: default avatarDavid Chinner <david@fromorbit.com>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
parent 7b2e2a31
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1333,7 +1333,7 @@ xfs_qm_dqflush_done(
	if ((qip->qli_item.li_flags & XFS_LI_IN_AIL) &&
	    qip->qli_item.li_lsn == qip->qli_flush_lsn) {

		spin_lock(&dqp->q_mount->m_ail_lock);
		spin_lock(&dqp->q_mount->m_ail->xa_lock);
		/*
		 * xfs_trans_delete_ail() drops the AIL lock.
		 */
@@ -1341,7 +1341,7 @@ xfs_qm_dqflush_done(
			xfs_trans_delete_ail(dqp->q_mount,
					     (xfs_log_item_t*)qip);
		else
			spin_unlock(&dqp->q_mount->m_ail_lock);
			spin_unlock(&dqp->q_mount->m_ail->xa_lock);
	}

	/*
+1 −1
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ xfs_qm_qoffend_logitem_committed(
	xfs_qoff_logitem_t	*qfs;

	qfs = qfe->qql_start_lip;
	spin_lock(&qfs->qql_item.li_mountp->m_ail_lock);
	spin_lock(&qfs->qql_item.li_mountp->m_ail->xa_lock);
	/*
	 * Delete the qoff-start logitem from the AIL.
	 * xfs_trans_delete_ail() drops the AIL lock.
+2 −2
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ xfs_buf_item_unpin(
			XFS_BUF_SET_FSPRIVATE(bp, NULL);
			XFS_BUF_CLR_IODONE_FUNC(bp);
		} else {
			spin_lock(&mp->m_ail_lock);
			spin_lock(&mp->m_ail->xa_lock);
			xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip);
			xfs_buf_item_relse(bp);
			ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL);
@@ -1138,7 +1138,7 @@ xfs_buf_iodone(
	 *
	 * Either way, AIL is useless if we're forcing a shutdown.
	 */
	spin_lock(&mp->m_ail_lock);
	spin_lock(&mp->m_ail->xa_lock);
	/*
	 * xfs_trans_delete_ail() drops the AIL lock.
	 */
+6 −6
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
	xfs_mount_t	*mp;

	mp = efip->efi_item.li_mountp;
	spin_lock(&mp->m_ail_lock);
	spin_lock(&mp->m_ail->xa_lock);
	if (efip->efi_flags & XFS_EFI_CANCELED) {
		/*
		 * xfs_trans_delete_ail() drops the AIL lock.
@@ -120,7 +120,7 @@ xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
		xfs_efi_item_free(efip);
	} else {
		efip->efi_flags |= XFS_EFI_COMMITTED;
		spin_unlock(&mp->m_ail_lock);
		spin_unlock(&mp->m_ail->xa_lock);
	}
}

@@ -138,7 +138,7 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
	xfs_log_item_desc_t	*lidp;

	mp = efip->efi_item.li_mountp;
	spin_lock(&mp->m_ail_lock);
	spin_lock(&mp->m_ail->xa_lock);
	if (efip->efi_flags & XFS_EFI_CANCELED) {
		/*
		 * free the xaction descriptor pointing to this item
@@ -153,7 +153,7 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
		xfs_efi_item_free(efip);
	} else {
		efip->efi_flags |= XFS_EFI_COMMITTED;
		spin_unlock(&mp->m_ail_lock);
		spin_unlock(&mp->m_ail->xa_lock);
	}
}

@@ -352,7 +352,7 @@ xfs_efi_release(xfs_efi_log_item_t *efip,
	ASSERT(efip->efi_next_extent > 0);
	ASSERT(efip->efi_flags & XFS_EFI_COMMITTED);

	spin_lock(&mp->m_ail_lock);
	spin_lock(&mp->m_ail->xa_lock);
	ASSERT(efip->efi_next_extent >= nextents);
	efip->efi_next_extent -= nextents;
	extents_left = efip->efi_next_extent;
@@ -363,7 +363,7 @@ xfs_efi_release(xfs_efi_log_item_t *efip,
		xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip);
		xfs_efi_item_free(efip);
	} else {
		spin_unlock(&mp->m_ail_lock);
		spin_unlock(&mp->m_ail->xa_lock);
	}
}

+2 −2
Original line number Diff line number Diff line
@@ -2715,11 +2715,11 @@ xfs_idestroy(
		ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
				       XFS_FORCED_SHUTDOWN(ip->i_mount));
		if (lip->li_flags & XFS_LI_IN_AIL) {
			spin_lock(&mp->m_ail_lock);
			spin_lock(&mp->m_ail->xa_lock);
			if (lip->li_flags & XFS_LI_IN_AIL)
				xfs_trans_delete_ail(mp, lip);
			else
				spin_unlock(&mp->m_ail_lock);
				spin_unlock(&mp->m_ail->xa_lock);
		}
		xfs_inode_item_destroy(ip);
		ip->i_itemp = NULL;
Loading