[XFS] Unwrap AIL_LOCK
SGI-PV: 970382 SGI-Modid: xfs-linux-melb:xfs-kern:29739a Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:

committed by
Lachlan McIlroy

父節點
541d7d3c4b
當前提交
287f3dad14
@@ -1209,7 +1209,6 @@ xfs_qm_dqflush(
|
||||
xfs_buf_t *bp;
|
||||
xfs_disk_dquot_t *ddqp;
|
||||
int error;
|
||||
SPLDECL(s);
|
||||
|
||||
ASSERT(XFS_DQ_IS_LOCKED(dqp));
|
||||
ASSERT(XFS_DQ_IS_FLUSH_LOCKED(dqp));
|
||||
@@ -1270,9 +1269,9 @@ xfs_qm_dqflush(
|
||||
mp = dqp->q_mount;
|
||||
|
||||
/* lsn is 64 bits */
|
||||
AIL_LOCK(mp, s);
|
||||
spin_lock(&mp->m_ail_lock);
|
||||
dqp->q_logitem.qli_flush_lsn = dqp->q_logitem.qli_item.li_lsn;
|
||||
AIL_UNLOCK(mp, s);
|
||||
spin_unlock(&mp->m_ail_lock);
|
||||
|
||||
/*
|
||||
* Attach an iodone routine so that we can remove this dquot from the
|
||||
@@ -1318,7 +1317,6 @@ xfs_qm_dqflush_done(
|
||||
xfs_dq_logitem_t *qip)
|
||||
{
|
||||
xfs_dquot_t *dqp;
|
||||
SPLDECL(s);
|
||||
|
||||
dqp = qip->qli_dquot;
|
||||
|
||||
@@ -1333,15 +1331,15 @@ xfs_qm_dqflush_done(
|
||||
if ((qip->qli_item.li_flags & XFS_LI_IN_AIL) &&
|
||||
qip->qli_item.li_lsn == qip->qli_flush_lsn) {
|
||||
|
||||
AIL_LOCK(dqp->q_mount, s);
|
||||
spin_lock(&dqp->q_mount->m_ail_lock);
|
||||
/*
|
||||
* xfs_trans_delete_ail() drops the AIL lock.
|
||||
*/
|
||||
if (qip->qli_item.li_lsn == qip->qli_flush_lsn)
|
||||
xfs_trans_delete_ail(dqp->q_mount,
|
||||
(xfs_log_item_t*)qip, s);
|
||||
(xfs_log_item_t*)qip);
|
||||
else
|
||||
AIL_UNLOCK(dqp->q_mount, s);
|
||||
spin_unlock(&dqp->q_mount->m_ail_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -216,8 +216,8 @@ xfs_qm_dqunpin_wait(
|
||||
* If so, we want to push it out to help us take this item off the AIL as soon
|
||||
* as possible.
|
||||
*
|
||||
* We must not be holding the AIL_LOCK at this point. Calling incore() to
|
||||
* search the buffer cache can be a time consuming thing, and AIL_LOCK is a
|
||||
* We must not be holding the AIL lock at this point. Calling incore() to
|
||||
* search the buffer cache can be a time consuming thing, and AIL lock is a
|
||||
* spinlock.
|
||||
*/
|
||||
STATIC void
|
||||
@@ -322,7 +322,7 @@ xfs_qm_dquot_logitem_trylock(
|
||||
* want to do that now since we might sleep in the device
|
||||
* strategy routine. We also don't want to grab the buffer lock
|
||||
* here because we'd like not to call into the buffer cache
|
||||
* while holding the AIL_LOCK.
|
||||
* while holding the AIL lock.
|
||||
* Make sure to only return PUSHBUF if we set pushbuf_flag
|
||||
* ourselves. If someone else is doing it then we don't
|
||||
* want to go to the push routine and duplicate their efforts.
|
||||
@@ -562,15 +562,14 @@ xfs_qm_qoffend_logitem_committed(
|
||||
xfs_lsn_t lsn)
|
||||
{
|
||||
xfs_qoff_logitem_t *qfs;
|
||||
SPLDECL(s);
|
||||
|
||||
qfs = qfe->qql_start_lip;
|
||||
AIL_LOCK(qfs->qql_item.li_mountp,s);
|
||||
spin_lock(&qfs->qql_item.li_mountp->m_ail_lock);
|
||||
/*
|
||||
* Delete the qoff-start logitem from the AIL.
|
||||
* xfs_trans_delete_ail() drops the AIL lock.
|
||||
*/
|
||||
xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs, s);
|
||||
xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs);
|
||||
kmem_free(qfs, sizeof(xfs_qoff_logitem_t));
|
||||
kmem_free(qfe, sizeof(xfs_qoff_logitem_t));
|
||||
return (xfs_lsn_t)-1;
|
||||
|
Reference in New Issue
Block a user