aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDonald Douwsma <donaldd@sgi.com>2007-10-11 03:36:05 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:44:23 -0500
commit287f3dad14828275d2517c8696ad118c82b9243f (patch)
tree4868d40f6c49984ff84f2957d84a3de160d46d7a /fs
parent541d7d3c4b31e2b0ac846fe6d2eb5cdbe1353095 (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')
-rw-r--r--fs/xfs/quota/xfs_dquot.c12
-rw-r--r--fs/xfs/quota/xfs_dquot_item.c11
-rw-r--r--fs/xfs/xfs_buf_item.c10
-rw-r--r--fs/xfs/xfs_extfree_item.c21
-rw-r--r--fs/xfs/xfs_inode.c22
-rw-r--r--fs/xfs/xfs_inode_item.c21
-rw-r--r--fs/xfs/xfs_log_recover.c21
-rw-r--r--fs/xfs/xfs_mount.c4
-rw-r--r--fs/xfs/xfs_mount.h9
-rw-r--r--fs/xfs/xfs_trans.c7
-rw-r--r--fs/xfs/xfs_trans_ail.c52
-rw-r--r--fs/xfs/xfs_trans_priv.h5
12 files changed, 81 insertions, 114 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 */
223STATIC void 223STATIC 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;
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index c8f2c2886fe4..63debd147eb5 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -378,7 +378,6 @@ xfs_buf_item_unpin(
378 xfs_mount_t *mp; 378 xfs_mount_t *mp;
379 xfs_buf_t *bp; 379 xfs_buf_t *bp;
380 int freed; 380 int freed;
381 SPLDECL(s);
382 381
383 bp = bip->bli_buf; 382 bp = bip->bli_buf;
384 ASSERT(bp != NULL); 383 ASSERT(bp != NULL);
@@ -409,8 +408,8 @@ xfs_buf_item_unpin(
409 XFS_BUF_SET_FSPRIVATE(bp, NULL); 408 XFS_BUF_SET_FSPRIVATE(bp, NULL);
410 XFS_BUF_CLR_IODONE_FUNC(bp); 409 XFS_BUF_CLR_IODONE_FUNC(bp);
411 } else { 410 } else {
412 AIL_LOCK(mp,s); 411 spin_lock(&mp->m_ail_lock);
413 xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip, s); 412 xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip);
414 xfs_buf_item_relse(bp); 413 xfs_buf_item_relse(bp);
415 ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL); 414 ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL);
416 } 415 }
@@ -1113,7 +1112,6 @@ xfs_buf_iodone(
1113 xfs_buf_log_item_t *bip) 1112 xfs_buf_log_item_t *bip)
1114{ 1113{
1115 struct xfs_mount *mp; 1114 struct xfs_mount *mp;
1116 SPLDECL(s);
1117 1115
1118 ASSERT(bip->bli_buf == bp); 1116 ASSERT(bip->bli_buf == bp);
1119 1117
@@ -1128,11 +1126,11 @@ xfs_buf_iodone(
1128 * 1126 *
1129 * Either way, AIL is useless if we're forcing a shutdown. 1127 * Either way, AIL is useless if we're forcing a shutdown.
1130 */ 1128 */
1131 AIL_LOCK(mp,s); 1129 spin_lock(&mp->m_ail_lock);
1132 /* 1130 /*
1133 * xfs_trans_delete_ail() drops the AIL lock. 1131 * xfs_trans_delete_ail() drops the AIL lock.
1134 */ 1132 */
1135 xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip, s); 1133 xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip);
1136 1134
1137#ifdef XFS_TRANS_DEBUG 1135#ifdef XFS_TRANS_DEBUG
1138 kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp)); 1136 kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp));
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index f938a51be81b..132bd07b9bb8 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -110,19 +110,18 @@ STATIC void
110xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale) 110xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale)
111{ 111{
112 xfs_mount_t *mp; 112 xfs_mount_t *mp;
113 SPLDECL(s);
114 113
115 mp = efip->efi_item.li_mountp; 114 mp = efip->efi_item.li_mountp;
116 AIL_LOCK(mp, s); 115 spin_lock(&mp->m_ail_lock);
117 if (efip->efi_flags & XFS_EFI_CANCELED) { 116 if (efip->efi_flags & XFS_EFI_CANCELED) {
118 /* 117 /*
119 * xfs_trans_delete_ail() drops the AIL lock. 118 * xfs_trans_delete_ail() drops the AIL lock.
120 */ 119 */
121 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s); 120 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip);
122 xfs_efi_item_free(efip); 121 xfs_efi_item_free(efip);
123 } else { 122 } else {
124 efip->efi_flags |= XFS_EFI_COMMITTED; 123 efip->efi_flags |= XFS_EFI_COMMITTED;
125 AIL_UNLOCK(mp, s); 124 spin_unlock(&mp->m_ail_lock);
126 } 125 }
127} 126}
128 127
@@ -138,10 +137,9 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
138{ 137{
139 xfs_mount_t *mp; 138 xfs_mount_t *mp;
140 xfs_log_item_desc_t *lidp; 139 xfs_log_item_desc_t *lidp;
141 SPLDECL(s);
142 140
143 mp = efip->efi_item.li_mountp; 141 mp = efip->efi_item.li_mountp;
144 AIL_LOCK(mp, s); 142 spin_lock(&mp->m_ail_lock);
145 if (efip->efi_flags & XFS_EFI_CANCELED) { 143 if (efip->efi_flags & XFS_EFI_CANCELED) {
146 /* 144 /*
147 * free the xaction descriptor pointing to this item 145 * free the xaction descriptor pointing to this item
@@ -152,11 +150,11 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp)
152 * pull the item off the AIL. 150 * pull the item off the AIL.
153 * xfs_trans_delete_ail() drops the AIL lock. 151 * xfs_trans_delete_ail() drops the AIL lock.
154 */ 152 */
155 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s); 153 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip);
156 xfs_efi_item_free(efip); 154 xfs_efi_item_free(efip);
157 } else { 155 } else {
158 efip->efi_flags |= XFS_EFI_COMMITTED; 156 efip->efi_flags |= XFS_EFI_COMMITTED;
159 AIL_UNLOCK(mp, s); 157 spin_unlock(&mp->m_ail_lock);
160 } 158 }
161} 159}
162 160
@@ -350,13 +348,12 @@ xfs_efi_release(xfs_efi_log_item_t *efip,
350{ 348{
351 xfs_mount_t *mp; 349 xfs_mount_t *mp;
352 int extents_left; 350 int extents_left;
353 SPLDECL(s);
354 351
355 mp = efip->efi_item.li_mountp; 352 mp = efip->efi_item.li_mountp;
356 ASSERT(efip->efi_next_extent > 0); 353 ASSERT(efip->efi_next_extent > 0);
357 ASSERT(efip->efi_flags & XFS_EFI_COMMITTED); 354 ASSERT(efip->efi_flags & XFS_EFI_COMMITTED);
358 355
359 AIL_LOCK(mp, s); 356 spin_lock(&mp->m_ail_lock);
360 ASSERT(efip->efi_next_extent >= nextents); 357 ASSERT(efip->efi_next_extent >= nextents);
361 efip->efi_next_extent -= nextents; 358 efip->efi_next_extent -= nextents;
362 extents_left = efip->efi_next_extent; 359 extents_left = efip->efi_next_extent;
@@ -364,10 +361,10 @@ xfs_efi_release(xfs_efi_log_item_t *efip,
364 /* 361 /*
365 * xfs_trans_delete_ail() drops the AIL lock. 362 * xfs_trans_delete_ail() drops the AIL lock.
366 */ 363 */
367 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip, s); 364 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip);
368 xfs_efi_item_free(efip); 365 xfs_efi_item_free(efip);
369 } else { 366 } else {
370 AIL_UNLOCK(mp, s); 367 spin_unlock(&mp->m_ail_lock);
371 } 368 }
372} 369}
373 370
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index a6d35aee93b2..e7930680fff4 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2205,7 +2205,6 @@ xfs_ifree_cluster(
2205 xfs_inode_log_item_t *iip; 2205 xfs_inode_log_item_t *iip;
2206 xfs_log_item_t *lip; 2206 xfs_log_item_t *lip;
2207 xfs_perag_t *pag = xfs_get_perag(mp, inum); 2207 xfs_perag_t *pag = xfs_get_perag(mp, inum);
2208 SPLDECL(s);
2209 2208
2210 if (mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) { 2209 if (mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) {
2211 blks_per_cluster = 1; 2210 blks_per_cluster = 1;
@@ -2307,9 +2306,9 @@ xfs_ifree_cluster(
2307 iip = (xfs_inode_log_item_t *)lip; 2306 iip = (xfs_inode_log_item_t *)lip;
2308 ASSERT(iip->ili_logged == 1); 2307 ASSERT(iip->ili_logged == 1);
2309 lip->li_cb = (void(*)(xfs_buf_t*,xfs_log_item_t*)) xfs_istale_done; 2308 lip->li_cb = (void(*)(xfs_buf_t*,xfs_log_item_t*)) xfs_istale_done;
2310 AIL_LOCK(mp,s); 2309 spin_lock(&mp->m_ail_lock);
2311 iip->ili_flush_lsn = iip->ili_item.li_lsn; 2310 iip->ili_flush_lsn = iip->ili_item.li_lsn;
2312 AIL_UNLOCK(mp, s); 2311 spin_unlock(&mp->m_ail_lock);
2313 xfs_iflags_set(iip->ili_inode, XFS_ISTALE); 2312 xfs_iflags_set(iip->ili_inode, XFS_ISTALE);
2314 pre_flushed++; 2313 pre_flushed++;
2315 } 2314 }
@@ -2330,9 +2329,9 @@ xfs_ifree_cluster(
2330 iip->ili_last_fields = iip->ili_format.ilf_fields; 2329 iip->ili_last_fields = iip->ili_format.ilf_fields;
2331 iip->ili_format.ilf_fields = 0; 2330 iip->ili_format.ilf_fields = 0;
2332 iip->ili_logged = 1; 2331 iip->ili_logged = 1;
2333 AIL_LOCK(mp,s); 2332 spin_lock(&mp->m_ail_lock);
2334 iip->ili_flush_lsn = iip->ili_item.li_lsn; 2333 iip->ili_flush_lsn = iip->ili_item.li_lsn;
2335 AIL_UNLOCK(mp, s); 2334 spin_unlock(&mp->m_ail_lock);
2336 2335
2337 xfs_buf_attach_iodone(bp, 2336 xfs_buf_attach_iodone(bp,
2338 (void(*)(xfs_buf_t*,xfs_log_item_t*)) 2337 (void(*)(xfs_buf_t*,xfs_log_item_t*))
@@ -2731,7 +2730,6 @@ void
2731xfs_idestroy( 2730xfs_idestroy(
2732 xfs_inode_t *ip) 2731 xfs_inode_t *ip)
2733{ 2732{
2734
2735 switch (ip->i_d.di_mode & S_IFMT) { 2733 switch (ip->i_d.di_mode & S_IFMT) {
2736 case S_IFREG: 2734 case S_IFREG:
2737 case S_IFDIR: 2735 case S_IFDIR:
@@ -2771,16 +2769,15 @@ xfs_idestroy(
2771 */ 2769 */
2772 xfs_mount_t *mp = ip->i_mount; 2770 xfs_mount_t *mp = ip->i_mount;
2773 xfs_log_item_t *lip = &ip->i_itemp->ili_item; 2771 xfs_log_item_t *lip = &ip->i_itemp->ili_item;
2774 int s;
2775 2772
2776 ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) || 2773 ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
2777 XFS_FORCED_SHUTDOWN(ip->i_mount)); 2774 XFS_FORCED_SHUTDOWN(ip->i_mount));
2778 if (lip->li_flags & XFS_LI_IN_AIL) { 2775 if (lip->li_flags & XFS_LI_IN_AIL) {
2779 AIL_LOCK(mp, s); 2776 spin_lock(&mp->m_ail_lock);
2780 if (lip->li_flags & XFS_LI_IN_AIL) 2777 if (lip->li_flags & XFS_LI_IN_AIL)
2781 xfs_trans_delete_ail(mp, lip, s); 2778 xfs_trans_delete_ail(mp, lip);
2782 else 2779 else
2783 AIL_UNLOCK(mp, s); 2780 spin_unlock(&mp->m_ail_lock);
2784 } 2781 }
2785 xfs_inode_item_destroy(ip); 2782 xfs_inode_item_destroy(ip);
2786 } 2783 }
@@ -3334,7 +3331,6 @@ xfs_iflush_int(
3334#ifdef XFS_TRANS_DEBUG 3331#ifdef XFS_TRANS_DEBUG
3335 int first; 3332 int first;
3336#endif 3333#endif
3337 SPLDECL(s);
3338 3334
3339 ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE|MR_ACCESS)); 3335 ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE|MR_ACCESS));
3340 ASSERT(issemalocked(&(ip->i_flock))); 3336 ASSERT(issemalocked(&(ip->i_flock)));
@@ -3529,9 +3525,9 @@ xfs_iflush_int(
3529 iip->ili_logged = 1; 3525 iip->ili_logged = 1;
3530 3526
3531 ASSERT(sizeof(xfs_lsn_t) == 8); /* don't lock if it shrinks */ 3527 ASSERT(sizeof(xfs_lsn_t) == 8); /* don't lock if it shrinks */
3532 AIL_LOCK(mp,s); 3528 spin_lock(&mp->m_ail_lock);
3533 iip->ili_flush_lsn = iip->ili_item.li_lsn; 3529 iip->ili_flush_lsn = iip->ili_item.li_lsn;
3534 AIL_UNLOCK(mp, s); 3530 spin_unlock(&mp->m_ail_lock);
3535 3531
3536 /* 3532 /*
3537 * Attach the function xfs_iflush_done to the inode's 3533 * Attach the function xfs_iflush_done to the inode's
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 565d470a6b4a..e365b137ee4f 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -615,7 +615,7 @@ xfs_inode_item_trylock(
615 return XFS_ITEM_PUSHBUF; 615 return XFS_ITEM_PUSHBUF;
616 } else { 616 } else {
617 /* 617 /*
618 * We hold the AIL_LOCK, so we must specify the 618 * We hold the AIL lock, so we must specify the
619 * NONOTIFY flag so that we won't double trip. 619 * NONOTIFY flag so that we won't double trip.
620 */ 620 */
621 xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY); 621 xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY);
@@ -749,7 +749,7 @@ xfs_inode_item_committed(
749 * marked delayed write. If that's the case, we'll initiate a bawrite on that 749 * marked delayed write. If that's the case, we'll initiate a bawrite on that
750 * buffer to expedite the process. 750 * buffer to expedite the process.
751 * 751 *
752 * We aren't holding the AIL_LOCK (or the flush lock) when this gets called, 752 * We aren't holding the AIL lock (or the flush lock) when this gets called,
753 * so it is inherently race-y. 753 * so it is inherently race-y.
754 */ 754 */
755STATIC void 755STATIC void
@@ -792,7 +792,7 @@ xfs_inode_item_pushbuf(
792 if (XFS_BUF_ISDELAYWRITE(bp)) { 792 if (XFS_BUF_ISDELAYWRITE(bp)) {
793 /* 793 /*
794 * We were racing with iflush because we don't hold 794 * We were racing with iflush because we don't hold
795 * the AIL_LOCK or the flush lock. However, at this point, 795 * the AIL lock or the flush lock. However, at this point,
796 * we have the buffer, and we know that it's dirty. 796 * we have the buffer, and we know that it's dirty.
797 * So, it's possible that iflush raced with us, and 797 * So, it's possible that iflush raced with us, and
798 * this item is already taken off the AIL. 798 * this item is already taken off the AIL.
@@ -968,7 +968,6 @@ xfs_iflush_done(
968 xfs_inode_log_item_t *iip) 968 xfs_inode_log_item_t *iip)
969{ 969{
970 xfs_inode_t *ip; 970 xfs_inode_t *ip;
971 SPLDECL(s);
972 971
973 ip = iip->ili_inode; 972 ip = iip->ili_inode;
974 973
@@ -983,15 +982,15 @@ xfs_iflush_done(
983 */ 982 */
984 if (iip->ili_logged && 983 if (iip->ili_logged &&
985 (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { 984 (iip->ili_item.li_lsn == iip->ili_flush_lsn)) {
986 AIL_LOCK(ip->i_mount, s); 985 spin_lock(&ip->i_mount->m_ail_lock);
987 if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { 986 if (iip->ili_item.li_lsn == iip->ili_flush_lsn) {
988 /* 987 /*
989 * xfs_trans_delete_ail() drops the AIL lock. 988 * xfs_trans_delete_ail() drops the AIL lock.
990 */ 989 */
991 xfs_trans_delete_ail(ip->i_mount, 990 xfs_trans_delete_ail(ip->i_mount,
992 (xfs_log_item_t*)iip, s); 991 (xfs_log_item_t*)iip);
993 } else { 992 } else {
994 AIL_UNLOCK(ip->i_mount, s); 993 spin_unlock(&ip->i_mount->m_ail_lock);
995 } 994 }
996 } 995 }
997 996
@@ -1025,21 +1024,19 @@ xfs_iflush_abort(
1025{ 1024{
1026 xfs_inode_log_item_t *iip; 1025 xfs_inode_log_item_t *iip;
1027 xfs_mount_t *mp; 1026 xfs_mount_t *mp;
1028 SPLDECL(s);
1029 1027
1030 iip = ip->i_itemp; 1028 iip = ip->i_itemp;
1031 mp = ip->i_mount; 1029 mp = ip->i_mount;
1032 if (iip) { 1030 if (iip) {
1033 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { 1031 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
1034 AIL_LOCK(mp, s); 1032 spin_lock(&mp->m_ail_lock);
1035 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { 1033 if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
1036 /* 1034 /*
1037 * xfs_trans_delete_ail() drops the AIL lock. 1035 * xfs_trans_delete_ail() drops the AIL lock.
1038 */ 1036 */
1039 xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip, 1037 xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip);
1040 s);
1041 } else 1038 } else
1042 AIL_UNLOCK(mp, s); 1039 spin_unlock(&mp->m_ail_lock);
1043 } 1040 }
1044 iip->ili_logged = 0; 1041 iip->ili_logged = 0;
1045 /* 1042 /*
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 851eca8a7150..4c39dc0e6841 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2660,7 +2660,6 @@ xlog_recover_do_efi_trans(
2660 xfs_mount_t *mp; 2660 xfs_mount_t *mp;
2661 xfs_efi_log_item_t *efip; 2661 xfs_efi_log_item_t *efip;
2662 xfs_efi_log_format_t *efi_formatp; 2662 xfs_efi_log_format_t *efi_formatp;
2663 SPLDECL(s);
2664 2663
2665 if (pass == XLOG_RECOVER_PASS1) { 2664 if (pass == XLOG_RECOVER_PASS1) {
2666 return 0; 2665 return 0;
@@ -2678,11 +2677,11 @@ xlog_recover_do_efi_trans(
2678 efip->efi_next_extent = efi_formatp->efi_nextents; 2677 efip->efi_next_extent = efi_formatp->efi_nextents;
2679 efip->efi_flags |= XFS_EFI_COMMITTED; 2678 efip->efi_flags |= XFS_EFI_COMMITTED;
2680 2679
2681 AIL_LOCK(mp,s); 2680 spin_lock(&mp->m_ail_lock);
2682 /* 2681 /*
2683 * xfs_trans_update_ail() drops the AIL lock. 2682 * xfs_trans_update_ail() drops the AIL lock.
2684 */ 2683 */
2685 xfs_trans_update_ail(mp, (xfs_log_item_t *)efip, lsn, s); 2684 xfs_trans_update_ail(mp, (xfs_log_item_t *)efip, lsn);
2686 return 0; 2685 return 0;
2687} 2686}
2688 2687
@@ -2707,7 +2706,6 @@ xlog_recover_do_efd_trans(
2707 xfs_log_item_t *lip; 2706 xfs_log_item_t *lip;
2708 int gen; 2707 int gen;
2709 __uint64_t efi_id; 2708 __uint64_t efi_id;
2710 SPLDECL(s);
2711 2709
2712 if (pass == XLOG_RECOVER_PASS1) { 2710 if (pass == XLOG_RECOVER_PASS1) {
2713 return; 2711 return;
@@ -2725,7 +2723,7 @@ xlog_recover_do_efd_trans(
2725 * in the AIL. 2723 * in the AIL.
2726 */ 2724 */
2727 mp = log->l_mp; 2725 mp = log->l_mp;
2728 AIL_LOCK(mp,s); 2726 spin_lock(&mp->m_ail_lock);
2729 lip = xfs_trans_first_ail(mp, &gen); 2727 lip = xfs_trans_first_ail(mp, &gen);
2730 while (lip != NULL) { 2728 while (lip != NULL) {
2731 if (lip->li_type == XFS_LI_EFI) { 2729 if (lip->li_type == XFS_LI_EFI) {
@@ -2735,7 +2733,7 @@ xlog_recover_do_efd_trans(
2735 * xfs_trans_delete_ail() drops the 2733 * xfs_trans_delete_ail() drops the
2736 * AIL lock. 2734 * AIL lock.
2737 */ 2735 */
2738 xfs_trans_delete_ail(mp, lip, s); 2736 xfs_trans_delete_ail(mp, lip);
2739 break; 2737 break;
2740 } 2738 }
2741 } 2739 }
@@ -2749,7 +2747,7 @@ xlog_recover_do_efd_trans(
2749 if (lip != NULL) { 2747 if (lip != NULL) {
2750 xfs_efi_item_free(efip); 2748 xfs_efi_item_free(efip);
2751 } else { 2749 } else {
2752 AIL_UNLOCK(mp, s); 2750 spin_unlock(&mp->m_ail_lock);
2753 } 2751 }
2754} 2752}
2755 2753
@@ -3075,10 +3073,9 @@ xlog_recover_process_efis(
3075 xfs_efi_log_item_t *efip; 3073 xfs_efi_log_item_t *efip;
3076 int gen; 3074 int gen;
3077 xfs_mount_t *mp; 3075 xfs_mount_t *mp;
3078 SPLDECL(s);
3079 3076
3080 mp = log->l_mp; 3077 mp = log->l_mp;
3081 AIL_LOCK(mp,s); 3078 spin_lock(&mp->m_ail_lock);
3082 3079
3083 lip = xfs_trans_first_ail(mp, &gen); 3080 lip = xfs_trans_first_ail(mp, &gen);
3084 while (lip != NULL) { 3081 while (lip != NULL) {
@@ -3099,12 +3096,12 @@ xlog_recover_process_efis(
3099 continue; 3096 continue;
3100 } 3097 }
3101 3098
3102 AIL_UNLOCK(mp, s); 3099 spin_unlock(&mp->m_ail_lock);
3103 xlog_recover_process_efi(mp, efip); 3100 xlog_recover_process_efi(mp, efip);
3104 AIL_LOCK(mp,s); 3101 spin_lock(&mp->m_ail_lock);
3105 lip = xfs_trans_next_ail(mp, lip, &gen, NULL); 3102 lip = xfs_trans_next_ail(mp, lip, &gen, NULL);
3106 } 3103 }
3107 AIL_UNLOCK(mp, s); 3104 spin_unlock(&mp->m_ail_lock);
3108} 3105}
3109 3106
3110/* 3107/*
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index f395f594e20c..9a80b5581844 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -136,7 +136,7 @@ xfs_mount_init(void)
136 mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; 136 mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
137 } 137 }
138 138
139 AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail"); 139 spinlock_init(&mp->m_ail_lock, "xfs_ail");
140 spinlock_init(&mp->m_sb_lock, "xfs_sb"); 140 spinlock_init(&mp->m_sb_lock, "xfs_sb");
141 mutex_init(&mp->m_ilock); 141 mutex_init(&mp->m_ilock);
142 mutex_init(&mp->m_growlock); 142 mutex_init(&mp->m_growlock);
@@ -171,7 +171,7 @@ xfs_mount_free(
171 sizeof(xfs_perag_t) * mp->m_sb.sb_agcount); 171 sizeof(xfs_perag_t) * mp->m_sb.sb_agcount);
172 } 172 }
173 173
174 AIL_LOCK_DESTROY(&mp->m_ail_lock); 174 spinlock_destroy(&mp->m_ail_lock);
175 spinlock_destroy(&mp->m_sb_lock); 175 spinlock_destroy(&mp->m_sb_lock);
176 mutex_destroy(&mp->m_ilock); 176 mutex_destroy(&mp->m_ilock);
177 mutex_destroy(&mp->m_growlock); 177 mutex_destroy(&mp->m_growlock);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index f7b761f09ab4..723f01f59cb8 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -63,13 +63,6 @@ struct xfs_extdelta;
63struct xfs_swapext; 63struct xfs_swapext;
64struct xfs_mru_cache; 64struct xfs_mru_cache;
65 65
66#define AIL_LOCK_T lock_t
67#define AIL_LOCKINIT(x,y) spinlock_init(x,y)
68#define AIL_LOCK_DESTROY(x) spinlock_destroy(x)
69#define AIL_LOCK(mp,s) s=mutex_spinlock(&(mp)->m_ail_lock)
70#define AIL_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_ail_lock, s)
71
72
73/* 66/*
74 * Prototypes and functions for the Data Migration subsystem. 67 * Prototypes and functions for the Data Migration subsystem.
75 */ 68 */
@@ -230,7 +223,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
230typedef struct xfs_mount { 223typedef struct xfs_mount {
231 struct super_block *m_super; 224 struct super_block *m_super;
232 xfs_tid_t m_tid; /* next unused tid for fs */ 225 xfs_tid_t m_tid; /* next unused tid for fs */
233 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */ 226 spinlock_t m_ail_lock; /* fs AIL mutex */
234 xfs_ail_entry_t m_ail; /* fs active log item list */ 227 xfs_ail_entry_t m_ail; /* fs active log item list */
235 uint m_ail_gen; /* fs AIL generation count */ 228 uint m_ail_gen; /* fs AIL generation count */
236 xfs_sb_t m_sb; /* copy of fs superblock */ 229 xfs_sb_t m_sb; /* copy of fs superblock */
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8878322ee793..71e4c8dcc69b 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -1322,7 +1322,6 @@ xfs_trans_chunk_committed(
1322 xfs_lsn_t item_lsn; 1322 xfs_lsn_t item_lsn;
1323 struct xfs_mount *mp; 1323 struct xfs_mount *mp;
1324 int i; 1324 int i;
1325 SPLDECL(s);
1326 1325
1327 lidp = licp->lic_descs; 1326 lidp = licp->lic_descs;
1328 for (i = 0; i < licp->lic_unused; i++, lidp++) { 1327 for (i = 0; i < licp->lic_unused; i++, lidp++) {
@@ -1363,7 +1362,7 @@ xfs_trans_chunk_committed(
1363 * the test below. 1362 * the test below.
1364 */ 1363 */
1365 mp = lip->li_mountp; 1364 mp = lip->li_mountp;
1366 AIL_LOCK(mp,s); 1365 spin_lock(&mp->m_ail_lock);
1367 if (XFS_LSN_CMP(item_lsn, lip->li_lsn) > 0) { 1366 if (XFS_LSN_CMP(item_lsn, lip->li_lsn) > 0) {
1368 /* 1367 /*
1369 * This will set the item's lsn to item_lsn 1368 * This will set the item's lsn to item_lsn
@@ -1372,9 +1371,9 @@ xfs_trans_chunk_committed(
1372 * 1371 *
1373 * xfs_trans_update_ail() drops the AIL lock. 1372 * xfs_trans_update_ail() drops the AIL lock.
1374 */ 1373 */
1375 xfs_trans_update_ail(mp, lip, item_lsn, s); 1374 xfs_trans_update_ail(mp, lip, item_lsn);
1376 } else { 1375 } else {
1377 AIL_UNLOCK(mp, s); 1376 spin_unlock(&mp->m_ail_lock);
1378 } 1377 }
1379 1378
1380 /* 1379 /*
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 5b2ff59f19cf..2d3c297259c2 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -55,16 +55,15 @@ xfs_trans_tail_ail(
55{ 55{
56 xfs_lsn_t lsn; 56 xfs_lsn_t lsn;
57 xfs_log_item_t *lip; 57 xfs_log_item_t *lip;
58 SPLDECL(s);
59 58
60 AIL_LOCK(mp,s); 59 spin_lock(&mp->m_ail_lock);
61 lip = xfs_ail_min(&(mp->m_ail)); 60 lip = xfs_ail_min(&(mp->m_ail));
62 if (lip == NULL) { 61 if (lip == NULL) {
63 lsn = (xfs_lsn_t)0; 62 lsn = (xfs_lsn_t)0;
64 } else { 63 } else {
65 lsn = lip->li_lsn; 64 lsn = lip->li_lsn;
66 } 65 }
67 AIL_UNLOCK(mp, s); 66 spin_unlock(&mp->m_ail_lock);
68 67
69 return lsn; 68 return lsn;
70} 69}
@@ -89,17 +88,16 @@ xfs_trans_push_ail(
89 int restarts; 88 int restarts;
90 int lock_result; 89 int lock_result;
91 int flush_log; 90 int flush_log;
92 SPLDECL(s);
93 91
94#define XFS_TRANS_PUSH_AIL_RESTARTS 1000 92#define XFS_TRANS_PUSH_AIL_RESTARTS 1000
95 93
96 AIL_LOCK(mp,s); 94 spin_lock(&mp->m_ail_lock);
97 lip = xfs_trans_first_ail(mp, &gen); 95 lip = xfs_trans_first_ail(mp, &gen);
98 if (lip == NULL || XFS_FORCED_SHUTDOWN(mp)) { 96 if (lip == NULL || XFS_FORCED_SHUTDOWN(mp)) {
99 /* 97 /*
100 * Just return if the AIL is empty. 98 * Just return if the AIL is empty.
101 */ 99 */
102 AIL_UNLOCK(mp, s); 100 spin_unlock(&mp->m_ail_lock);
103 return (xfs_lsn_t)0; 101 return (xfs_lsn_t)0;
104 } 102 }
105 103
@@ -112,7 +110,7 @@ xfs_trans_push_ail(
112 * beginning of the list. We'd like not to stop until we've at least 110 * beginning of the list. We'd like not to stop until we've at least
113 * tried to push on everything in the AIL with an LSN less than 111 * tried to push on everything in the AIL with an LSN less than
114 * the given threshold. However, we may give up before that if 112 * the given threshold. However, we may give up before that if
115 * we realize that we've been holding the AIL_LOCK for 'too long', 113 * we realize that we've been holding the AIL lock for 'too long',
116 * blocking interrupts. Currently, too long is < 500us roughly. 114 * blocking interrupts. Currently, too long is < 500us roughly.
117 */ 115 */
118 flush_log = 0; 116 flush_log = 0;
@@ -136,14 +134,14 @@ xfs_trans_push_ail(
136 lock_result = IOP_TRYLOCK(lip); 134 lock_result = IOP_TRYLOCK(lip);
137 switch (lock_result) { 135 switch (lock_result) {
138 case XFS_ITEM_SUCCESS: 136 case XFS_ITEM_SUCCESS:
139 AIL_UNLOCK(mp, s); 137 spin_unlock(&mp->m_ail_lock);
140 XFS_STATS_INC(xs_push_ail_success); 138 XFS_STATS_INC(xs_push_ail_success);
141 IOP_PUSH(lip); 139 IOP_PUSH(lip);
142 AIL_LOCK(mp,s); 140 spin_lock(&mp->m_ail_lock);
143 break; 141 break;
144 142
145 case XFS_ITEM_PUSHBUF: 143 case XFS_ITEM_PUSHBUF:
146 AIL_UNLOCK(mp, s); 144 spin_unlock(&mp->m_ail_lock);
147 XFS_STATS_INC(xs_push_ail_pushbuf); 145 XFS_STATS_INC(xs_push_ail_pushbuf);
148#ifdef XFSRACEDEBUG 146#ifdef XFSRACEDEBUG
149 delay_for_intr(); 147 delay_for_intr();
@@ -152,7 +150,7 @@ xfs_trans_push_ail(
152 ASSERT(lip->li_ops->iop_pushbuf); 150 ASSERT(lip->li_ops->iop_pushbuf);
153 ASSERT(lip); 151 ASSERT(lip);
154 IOP_PUSHBUF(lip); 152 IOP_PUSHBUF(lip);
155 AIL_LOCK(mp,s); 153 spin_lock(&mp->m_ail_lock);
156 break; 154 break;
157 155
158 case XFS_ITEM_PINNED: 156 case XFS_ITEM_PINNED:
@@ -181,7 +179,7 @@ xfs_trans_push_ail(
181 /* 179 /*
182 * Just return if we shut down during the last try. 180 * Just return if we shut down during the last try.
183 */ 181 */
184 AIL_UNLOCK(mp, s); 182 spin_unlock(&mp->m_ail_lock);
185 return (xfs_lsn_t)0; 183 return (xfs_lsn_t)0;
186 } 184 }
187 185
@@ -193,10 +191,10 @@ xfs_trans_push_ail(
193 * push out the log so it will become unpinned and 191 * push out the log so it will become unpinned and
194 * move forward in the AIL. 192 * move forward in the AIL.
195 */ 193 */
196 AIL_UNLOCK(mp, s); 194 spin_unlock(&mp->m_ail_lock);
197 XFS_STATS_INC(xs_push_ail_flush); 195 XFS_STATS_INC(xs_push_ail_flush);
198 xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); 196 xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE);
199 AIL_LOCK(mp, s); 197 spin_lock(&mp->m_ail_lock);
200 } 198 }
201 199
202 lip = xfs_ail_min(&(mp->m_ail)); 200 lip = xfs_ail_min(&(mp->m_ail));
@@ -206,7 +204,7 @@ xfs_trans_push_ail(
206 lsn = lip->li_lsn; 204 lsn = lip->li_lsn;
207 } 205 }
208 206
209 AIL_UNLOCK(mp, s); 207 spin_unlock(&mp->m_ail_lock);
210 return lsn; 208 return lsn;
211} /* xfs_trans_push_ail */ 209} /* xfs_trans_push_ail */
212 210
@@ -269,15 +267,13 @@ xfs_trans_unlocked_item(
269 * has changed. 267 * has changed.
270 * 268 *
271 * This function must be called with the AIL lock held. The lock 269 * This function must be called with the AIL lock held. The lock
272 * is dropped before returning, so the caller must pass in the 270 * is dropped before returning.
273 * cookie returned by AIL_LOCK.
274 */ 271 */
275void 272void
276xfs_trans_update_ail( 273xfs_trans_update_ail(
277 xfs_mount_t *mp, 274 xfs_mount_t *mp,
278 xfs_log_item_t *lip, 275 xfs_log_item_t *lip,
279 xfs_lsn_t lsn, 276 xfs_lsn_t lsn) __releases(mp->m_ail_lock)
280 unsigned long s) __releases(mp->m_ail_lock)
281{ 277{
282 xfs_ail_entry_t *ailp; 278 xfs_ail_entry_t *ailp;
283 xfs_log_item_t *dlip=NULL; 279 xfs_log_item_t *dlip=NULL;
@@ -300,10 +296,10 @@ xfs_trans_update_ail(
300 296
301 if (mlip == dlip) { 297 if (mlip == dlip) {
302 mlip = xfs_ail_min(&(mp->m_ail)); 298 mlip = xfs_ail_min(&(mp->m_ail));
303 AIL_UNLOCK(mp, s); 299 spin_unlock(&mp->m_ail_lock);
304 xfs_log_move_tail(mp, mlip->li_lsn); 300 xfs_log_move_tail(mp, mlip->li_lsn);
305 } else { 301 } else {
306 AIL_UNLOCK(mp, s); 302 spin_unlock(&mp->m_ail_lock);
307 } 303 }
308 304
309 305
@@ -322,14 +318,12 @@ xfs_trans_update_ail(
322 * has changed. 318 * has changed.
323 * 319 *
324 * This function must be called with the AIL lock held. The lock 320 * This function must be called with the AIL lock held. The lock
325 * is dropped before returning, so the caller must pass in the 321 * is dropped before returning.
326 * cookie returned by AIL_LOCK.
327 */ 322 */
328void 323void
329xfs_trans_delete_ail( 324xfs_trans_delete_ail(
330 xfs_mount_t *mp, 325 xfs_mount_t *mp,
331 xfs_log_item_t *lip, 326 xfs_log_item_t *lip) __releases(mp->m_ail_lock)
332 unsigned long s) __releases(mp->m_ail_lock)
333{ 327{
334 xfs_ail_entry_t *ailp; 328 xfs_ail_entry_t *ailp;
335 xfs_log_item_t *dlip; 329 xfs_log_item_t *dlip;
@@ -348,10 +342,10 @@ xfs_trans_delete_ail(
348 342
349 if (mlip == dlip) { 343 if (mlip == dlip) {
350 mlip = xfs_ail_min(&(mp->m_ail)); 344 mlip = xfs_ail_min(&(mp->m_ail));
351 AIL_UNLOCK(mp, s); 345 spin_unlock(&mp->m_ail_lock);
352 xfs_log_move_tail(mp, (mlip ? mlip->li_lsn : 0)); 346 xfs_log_move_tail(mp, (mlip ? mlip->li_lsn : 0));
353 } else { 347 } else {
354 AIL_UNLOCK(mp, s); 348 spin_unlock(&mp->m_ail_lock);
355 } 349 }
356 } 350 }
357 else { 351 else {
@@ -360,12 +354,12 @@ xfs_trans_delete_ail(
360 * serious trouble if we get to this stage. 354 * serious trouble if we get to this stage.
361 */ 355 */
362 if (XFS_FORCED_SHUTDOWN(mp)) 356 if (XFS_FORCED_SHUTDOWN(mp))
363 AIL_UNLOCK(mp, s); 357 spin_unlock(&mp->m_ail_lock);
364 else { 358 else {
365 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp, 359 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp,
366 "%s: attempting to delete a log item that is not in the AIL", 360 "%s: attempting to delete a log item that is not in the AIL",
367 __FUNCTION__); 361 __FUNCTION__);
368 AIL_UNLOCK(mp, s); 362 spin_unlock(&mp->m_ail_lock);
369 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); 363 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
370 } 364 }
371 } 365 }
diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h
index 447ac4308c91..c40f0512097a 100644
--- a/fs/xfs/xfs_trans_priv.h
+++ b/fs/xfs/xfs_trans_priv.h
@@ -47,11 +47,10 @@ xfs_log_busy_slot_t *xfs_trans_add_busy(xfs_trans_t *tp,
47 * From xfs_trans_ail.c 47 * From xfs_trans_ail.c
48 */ 48 */
49void xfs_trans_update_ail(struct xfs_mount *mp, 49void xfs_trans_update_ail(struct xfs_mount *mp,
50 struct xfs_log_item *lip, xfs_lsn_t lsn, 50 struct xfs_log_item *lip, xfs_lsn_t lsn)
51 unsigned long s)
52 __releases(mp->m_ail_lock); 51 __releases(mp->m_ail_lock);
53void xfs_trans_delete_ail(struct xfs_mount *mp, 52void xfs_trans_delete_ail(struct xfs_mount *mp,
54 struct xfs_log_item *lip, unsigned long s) 53 struct xfs_log_item *lip)
55 __releases(mp->m_ail_lock); 54 __releases(mp->m_ail_lock);
56struct xfs_log_item *xfs_trans_first_ail(struct xfs_mount *, int *); 55struct xfs_log_item *xfs_trans_first_ail(struct xfs_mount *, int *);
57struct xfs_log_item *xfs_trans_next_ail(struct xfs_mount *, 56struct xfs_log_item *xfs_trans_next_ail(struct xfs_mount *,