diff options
Diffstat (limited to 'fs/xfs/quota/xfs_dquot_item.c')
-rw-r--r-- | fs/xfs/quota/xfs_dquot_item.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index ddb61fe22a5c..1800e8d1f646 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -94,14 +94,13 @@ STATIC void | |||
94 | xfs_qm_dquot_logitem_pin( | 94 | xfs_qm_dquot_logitem_pin( |
95 | xfs_dq_logitem_t *logitem) | 95 | xfs_dq_logitem_t *logitem) |
96 | { | 96 | { |
97 | unsigned long s; | ||
98 | xfs_dquot_t *dqp; | 97 | xfs_dquot_t *dqp; |
99 | 98 | ||
100 | dqp = logitem->qli_dquot; | 99 | dqp = logitem->qli_dquot; |
101 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 100 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
102 | s = XFS_DQ_PINLOCK(dqp); | 101 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
103 | dqp->q_pincount++; | 102 | dqp->q_pincount++; |
104 | XFS_DQ_PINUNLOCK(dqp, s); | 103 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
105 | } | 104 | } |
106 | 105 | ||
107 | /* | 106 | /* |
@@ -115,17 +114,16 @@ xfs_qm_dquot_logitem_unpin( | |||
115 | xfs_dq_logitem_t *logitem, | 114 | xfs_dq_logitem_t *logitem, |
116 | int stale) | 115 | int stale) |
117 | { | 116 | { |
118 | unsigned long s; | ||
119 | xfs_dquot_t *dqp; | 117 | xfs_dquot_t *dqp; |
120 | 118 | ||
121 | dqp = logitem->qli_dquot; | 119 | dqp = logitem->qli_dquot; |
122 | ASSERT(dqp->q_pincount > 0); | 120 | ASSERT(dqp->q_pincount > 0); |
123 | s = XFS_DQ_PINLOCK(dqp); | 121 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
124 | dqp->q_pincount--; | 122 | dqp->q_pincount--; |
125 | if (dqp->q_pincount == 0) { | 123 | if (dqp->q_pincount == 0) { |
126 | sv_broadcast(&dqp->q_pinwait); | 124 | sv_broadcast(&dqp->q_pinwait); |
127 | } | 125 | } |
128 | XFS_DQ_PINUNLOCK(dqp, s); | 126 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
129 | } | 127 | } |
130 | 128 | ||
131 | /* ARGSUSED */ | 129 | /* ARGSUSED */ |
@@ -189,8 +187,6 @@ void | |||
189 | xfs_qm_dqunpin_wait( | 187 | xfs_qm_dqunpin_wait( |
190 | xfs_dquot_t *dqp) | 188 | xfs_dquot_t *dqp) |
191 | { | 189 | { |
192 | SPLDECL(s); | ||
193 | |||
194 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 190 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
195 | if (dqp->q_pincount == 0) { | 191 | if (dqp->q_pincount == 0) { |
196 | return; | 192 | return; |
@@ -200,9 +196,9 @@ xfs_qm_dqunpin_wait( | |||
200 | * Give the log a push so we don't wait here too long. | 196 | * Give the log a push so we don't wait here too long. |
201 | */ | 197 | */ |
202 | xfs_log_force(dqp->q_mount, (xfs_lsn_t)0, XFS_LOG_FORCE); | 198 | xfs_log_force(dqp->q_mount, (xfs_lsn_t)0, XFS_LOG_FORCE); |
203 | s = XFS_DQ_PINLOCK(dqp); | 199 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
204 | if (dqp->q_pincount == 0) { | 200 | if (dqp->q_pincount == 0) { |
205 | XFS_DQ_PINUNLOCK(dqp, s); | 201 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
206 | return; | 202 | return; |
207 | } | 203 | } |
208 | sv_wait(&(dqp->q_pinwait), PINOD, | 204 | sv_wait(&(dqp->q_pinwait), PINOD, |
@@ -216,8 +212,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 | 212 | * If so, we want to push it out to help us take this item off the AIL as soon |
217 | * as possible. | 213 | * as possible. |
218 | * | 214 | * |
219 | * We must not be holding the AIL_LOCK at this point. Calling incore() to | 215 | * 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 | 216 | * search the buffer cache can be a time consuming thing, and AIL lock is a |
221 | * spinlock. | 217 | * spinlock. |
222 | */ | 218 | */ |
223 | STATIC void | 219 | STATIC void |
@@ -322,7 +318,7 @@ xfs_qm_dquot_logitem_trylock( | |||
322 | * want to do that now since we might sleep in the device | 318 | * 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 | 319 | * 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 | 320 | * here because we'd like not to call into the buffer cache |
325 | * while holding the AIL_LOCK. | 321 | * while holding the AIL lock. |
326 | * Make sure to only return PUSHBUF if we set pushbuf_flag | 322 | * Make sure to only return PUSHBUF if we set pushbuf_flag |
327 | * ourselves. If someone else is doing it then we don't | 323 | * ourselves. If someone else is doing it then we don't |
328 | * want to go to the push routine and duplicate their efforts. | 324 | * want to go to the push routine and duplicate their efforts. |
@@ -562,15 +558,14 @@ xfs_qm_qoffend_logitem_committed( | |||
562 | xfs_lsn_t lsn) | 558 | xfs_lsn_t lsn) |
563 | { | 559 | { |
564 | xfs_qoff_logitem_t *qfs; | 560 | xfs_qoff_logitem_t *qfs; |
565 | SPLDECL(s); | ||
566 | 561 | ||
567 | qfs = qfe->qql_start_lip; | 562 | qfs = qfe->qql_start_lip; |
568 | AIL_LOCK(qfs->qql_item.li_mountp,s); | 563 | spin_lock(&qfs->qql_item.li_mountp->m_ail_lock); |
569 | /* | 564 | /* |
570 | * Delete the qoff-start logitem from the AIL. | 565 | * Delete the qoff-start logitem from the AIL. |
571 | * xfs_trans_delete_ail() drops the AIL lock. | 566 | * xfs_trans_delete_ail() drops the AIL lock. |
572 | */ | 567 | */ |
573 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs, s); | 568 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs); |
574 | kmem_free(qfs, sizeof(xfs_qoff_logitem_t)); | 569 | kmem_free(qfs, sizeof(xfs_qoff_logitem_t)); |
575 | kmem_free(qfe, sizeof(xfs_qoff_logitem_t)); | 570 | kmem_free(qfe, sizeof(xfs_qoff_logitem_t)); |
576 | return (xfs_lsn_t)-1; | 571 | return (xfs_lsn_t)-1; |