diff options
author | Donald Douwsma <donaldd@sgi.com> | 2007-10-11 03:36:05 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 00:44:23 -0500 |
commit | 287f3dad14828275d2517c8696ad118c82b9243f (patch) | |
tree | 4868d40f6c49984ff84f2957d84a3de160d46d7a /fs/xfs/quota | |
parent | 541d7d3c4b31e2b0ac846fe6d2eb5cdbe1353095 (diff) |
[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>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 12 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot_item.c | 11 |
2 files changed, 10 insertions, 13 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index cfdd35ee9f7a..665babcca6a6 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -1209,7 +1209,6 @@ xfs_qm_dqflush( | |||
1209 | xfs_buf_t *bp; | 1209 | xfs_buf_t *bp; |
1210 | xfs_disk_dquot_t *ddqp; | 1210 | xfs_disk_dquot_t *ddqp; |
1211 | int error; | 1211 | int error; |
1212 | SPLDECL(s); | ||
1213 | 1212 | ||
1214 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 1213 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
1215 | ASSERT(XFS_DQ_IS_FLUSH_LOCKED(dqp)); | 1214 | ASSERT(XFS_DQ_IS_FLUSH_LOCKED(dqp)); |
@@ -1270,9 +1269,9 @@ xfs_qm_dqflush( | |||
1270 | mp = dqp->q_mount; | 1269 | mp = dqp->q_mount; |
1271 | 1270 | ||
1272 | /* lsn is 64 bits */ | 1271 | /* lsn is 64 bits */ |
1273 | AIL_LOCK(mp, s); | 1272 | spin_lock(&mp->m_ail_lock); |
1274 | dqp->q_logitem.qli_flush_lsn = dqp->q_logitem.qli_item.li_lsn; | 1273 | dqp->q_logitem.qli_flush_lsn = dqp->q_logitem.qli_item.li_lsn; |
1275 | AIL_UNLOCK(mp, s); | 1274 | spin_unlock(&mp->m_ail_lock); |
1276 | 1275 | ||
1277 | /* | 1276 | /* |
1278 | * Attach an iodone routine so that we can remove this dquot from the | 1277 | * Attach an iodone routine so that we can remove this dquot from the |
@@ -1318,7 +1317,6 @@ xfs_qm_dqflush_done( | |||
1318 | xfs_dq_logitem_t *qip) | 1317 | xfs_dq_logitem_t *qip) |
1319 | { | 1318 | { |
1320 | xfs_dquot_t *dqp; | 1319 | xfs_dquot_t *dqp; |
1321 | SPLDECL(s); | ||
1322 | 1320 | ||
1323 | dqp = qip->qli_dquot; | 1321 | dqp = qip->qli_dquot; |
1324 | 1322 | ||
@@ -1333,15 +1331,15 @@ xfs_qm_dqflush_done( | |||
1333 | if ((qip->qli_item.li_flags & XFS_LI_IN_AIL) && | 1331 | if ((qip->qli_item.li_flags & XFS_LI_IN_AIL) && |
1334 | qip->qli_item.li_lsn == qip->qli_flush_lsn) { | 1332 | qip->qli_item.li_lsn == qip->qli_flush_lsn) { |
1335 | 1333 | ||
1336 | AIL_LOCK(dqp->q_mount, s); | 1334 | spin_lock(&dqp->q_mount->m_ail_lock); |
1337 | /* | 1335 | /* |
1338 | * xfs_trans_delete_ail() drops the AIL lock. | 1336 | * xfs_trans_delete_ail() drops the AIL lock. |
1339 | */ | 1337 | */ |
1340 | if (qip->qli_item.li_lsn == qip->qli_flush_lsn) | 1338 | if (qip->qli_item.li_lsn == qip->qli_flush_lsn) |
1341 | xfs_trans_delete_ail(dqp->q_mount, | 1339 | xfs_trans_delete_ail(dqp->q_mount, |
1342 | (xfs_log_item_t*)qip, s); | 1340 | (xfs_log_item_t*)qip); |
1343 | else | 1341 | else |
1344 | AIL_UNLOCK(dqp->q_mount, s); | 1342 | spin_unlock(&dqp->q_mount->m_ail_lock); |
1345 | } | 1343 | } |
1346 | 1344 | ||
1347 | /* | 1345 | /* |
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index ddb61fe22a5c..a00b71b05a37 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -216,8 +216,8 @@ xfs_qm_dqunpin_wait( | |||
216 | * If so, we want to push it out to help us take this item off the AIL as soon | 216 | * If so, we want to push it out to help us take this item off the AIL as soon |
217 | * as possible. | 217 | * as possible. |
218 | * | 218 | * |
219 | * We must not be holding the AIL_LOCK at this point. Calling incore() to | 219 | * We must not be holding the AIL lock at this point. Calling incore() to |
220 | * search the buffer cache can be a time consuming thing, and AIL_LOCK is a | 220 | * search the buffer cache can be a time consuming thing, and AIL lock is a |
221 | * spinlock. | 221 | * spinlock. |
222 | */ | 222 | */ |
223 | STATIC void | 223 | STATIC void |
@@ -322,7 +322,7 @@ xfs_qm_dquot_logitem_trylock( | |||
322 | * want to do that now since we might sleep in the device | 322 | * want to do that now since we might sleep in the device |
323 | * strategy routine. We also don't want to grab the buffer lock | 323 | * strategy routine. We also don't want to grab the buffer lock |
324 | * here because we'd like not to call into the buffer cache | 324 | * here because we'd like not to call into the buffer cache |
325 | * while holding the AIL_LOCK. | 325 | * while holding the AIL lock. |
326 | * Make sure to only return PUSHBUF if we set pushbuf_flag | 326 | * Make sure to only return PUSHBUF if we set pushbuf_flag |
327 | * ourselves. If someone else is doing it then we don't | 327 | * ourselves. If someone else is doing it then we don't |
328 | * want to go to the push routine and duplicate their efforts. | 328 | * want to go to the push routine and duplicate their efforts. |
@@ -562,15 +562,14 @@ xfs_qm_qoffend_logitem_committed( | |||
562 | xfs_lsn_t lsn) | 562 | xfs_lsn_t lsn) |
563 | { | 563 | { |
564 | xfs_qoff_logitem_t *qfs; | 564 | xfs_qoff_logitem_t *qfs; |
565 | SPLDECL(s); | ||
566 | 565 | ||
567 | qfs = qfe->qql_start_lip; | 566 | qfs = qfe->qql_start_lip; |
568 | AIL_LOCK(qfs->qql_item.li_mountp,s); | 567 | spin_lock(&qfs->qql_item.li_mountp->m_ail_lock); |
569 | /* | 568 | /* |
570 | * Delete the qoff-start logitem from the AIL. | 569 | * Delete the qoff-start logitem from the AIL. |
571 | * xfs_trans_delete_ail() drops the AIL lock. | 570 | * xfs_trans_delete_ail() drops the AIL lock. |
572 | */ | 571 | */ |
573 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs, s); | 572 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs); |
574 | kmem_free(qfs, sizeof(xfs_qoff_logitem_t)); | 573 | kmem_free(qfs, sizeof(xfs_qoff_logitem_t)); |
575 | kmem_free(qfe, sizeof(xfs_qoff_logitem_t)); | 574 | kmem_free(qfe, sizeof(xfs_qoff_logitem_t)); |
576 | return (xfs_lsn_t)-1; | 575 | return (xfs_lsn_t)-1; |