aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_ail.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:39:58 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:39:58 -0400
commit783a2f656f9674c31d4019708a94af93fa1d1c22 (patch)
tree7ac2123b187c0522dbd8a0d94de3856b33147c46 /fs/xfs/xfs_trans_ail.c
parentfc1829f34d30899701dfd5890030d39e13e1f47d (diff)
[XFS] Finish removing the mount pointer from the AIL API
Change all the remaining AIL API functions that are passed struct xfs_mount pointers to pass pointers directly to the struct xfs_ail being used. With this conversion, all external access to the AIL is via the struct xfs_ail. Hence the operation and referencing of the AIL is almost entirely independent of the xfs_mount that is using it - it is now much more tightly tied to the log and the items it is tracking in the log than it is tied to the xfs_mount. SGI-PV: 988143 SGI-Modid: xfs-linux-melb:xfs-kern:32353a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/xfs_trans_ail.c')
-rw-r--r--fs/xfs/xfs_trans_ail.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 0cd47a797d32..67ee4663336c 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -86,16 +86,16 @@ xfs_trans_ail_tail(
86 * any of the objects, so the lock is not needed. 86 * any of the objects, so the lock is not needed.
87 */ 87 */
88void 88void
89xfs_trans_push_ail( 89xfs_trans_ail_push(
90 xfs_mount_t *mp, 90 struct xfs_ail *ailp,
91 xfs_lsn_t threshold_lsn) 91 xfs_lsn_t threshold_lsn)
92{ 92{
93 xfs_log_item_t *lip; 93 xfs_log_item_t *lip;
94 94
95 lip = xfs_ail_min(mp->m_ail); 95 lip = xfs_ail_min(ailp);
96 if (lip && !XFS_FORCED_SHUTDOWN(mp)) { 96 if (lip && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) {
97 if (XFS_LSN_CMP(threshold_lsn, mp->m_ail->xa_target) > 0) 97 if (XFS_LSN_CMP(threshold_lsn, ailp->xa_target) > 0)
98 xfsaild_wakeup(mp->m_ail, threshold_lsn); 98 xfsaild_wakeup(ailp, threshold_lsn);
99 } 99 }
100} 100}
101 101
@@ -412,7 +412,7 @@ xfsaild_push(
412 */ 412 */
413void 413void
414xfs_trans_unlocked_item( 414xfs_trans_unlocked_item(
415 xfs_mount_t *mp, 415 struct xfs_ail *ailp,
416 xfs_log_item_t *lip) 416 xfs_log_item_t *lip)
417{ 417{
418 xfs_log_item_t *min_lip; 418 xfs_log_item_t *min_lip;
@@ -424,7 +424,7 @@ xfs_trans_unlocked_item(
424 * over some potentially valid data. 424 * over some potentially valid data.
425 */ 425 */
426 if (!(lip->li_flags & XFS_LI_IN_AIL) || 426 if (!(lip->li_flags & XFS_LI_IN_AIL) ||
427 XFS_FORCED_SHUTDOWN(mp)) { 427 XFS_FORCED_SHUTDOWN(ailp->xa_mount)) {
428 return; 428 return;
429 } 429 }
430 430
@@ -440,10 +440,10 @@ xfs_trans_unlocked_item(
440 * the call to xfs_log_move_tail() doesn't do anything if there's 440 * the call to xfs_log_move_tail() doesn't do anything if there's
441 * not enough free space to wake people up so we're safe calling it. 441 * not enough free space to wake people up so we're safe calling it.
442 */ 442 */
443 min_lip = xfs_ail_min(mp->m_ail); 443 min_lip = xfs_ail_min(ailp);
444 444
445 if (min_lip == lip) 445 if (min_lip == lip)
446 xfs_log_move_tail(mp, 1); 446 xfs_log_move_tail(ailp->xa_mount, 1);
447} /* xfs_trans_unlocked_item */ 447} /* xfs_trans_unlocked_item */
448 448
449 449
@@ -460,12 +460,11 @@ xfs_trans_unlocked_item(
460 * is dropped before returning. 460 * is dropped before returning.
461 */ 461 */
462void 462void
463xfs_trans_update_ail( 463xfs_trans_ail_update(
464 xfs_mount_t *mp, 464 struct xfs_ail *ailp,
465 xfs_log_item_t *lip, 465 xfs_log_item_t *lip,
466 xfs_lsn_t lsn) __releases(ailp->xa_lock) 466 xfs_lsn_t lsn) __releases(ailp->xa_lock)
467{ 467{
468 struct xfs_ail *ailp = mp->m_ail;
469 xfs_log_item_t *dlip = NULL; 468 xfs_log_item_t *dlip = NULL;
470 xfs_log_item_t *mlip; /* ptr to minimum lip */ 469 xfs_log_item_t *mlip; /* ptr to minimum lip */
471 470
@@ -485,7 +484,7 @@ xfs_trans_update_ail(
485 if (mlip == dlip) { 484 if (mlip == dlip) {
486 mlip = xfs_ail_min(ailp); 485 mlip = xfs_ail_min(ailp);
487 spin_unlock(&ailp->xa_lock); 486 spin_unlock(&ailp->xa_lock);
488 xfs_log_move_tail(mp, mlip->li_lsn); 487 xfs_log_move_tail(ailp->xa_mount, mlip->li_lsn);
489 } else { 488 } else {
490 spin_unlock(&ailp->xa_lock); 489 spin_unlock(&ailp->xa_lock);
491 } 490 }
@@ -509,11 +508,10 @@ xfs_trans_update_ail(
509 * is dropped before returning. 508 * is dropped before returning.
510 */ 509 */
511void 510void
512xfs_trans_delete_ail( 511xfs_trans_ail_delete(
513 xfs_mount_t *mp, 512 struct xfs_ail *ailp,
514 xfs_log_item_t *lip) __releases(ailp->xa_lock) 513 xfs_log_item_t *lip) __releases(ailp->xa_lock)
515{ 514{
516 struct xfs_ail *ailp = mp->m_ail;
517 xfs_log_item_t *dlip; 515 xfs_log_item_t *dlip;
518 xfs_log_item_t *mlip; 516 xfs_log_item_t *mlip;
519 517
@@ -530,7 +528,8 @@ xfs_trans_delete_ail(
530 if (mlip == dlip) { 528 if (mlip == dlip) {
531 mlip = xfs_ail_min(ailp); 529 mlip = xfs_ail_min(ailp);
532 spin_unlock(&ailp->xa_lock); 530 spin_unlock(&ailp->xa_lock);
533 xfs_log_move_tail(mp, (mlip ? mlip->li_lsn : 0)); 531 xfs_log_move_tail(ailp->xa_mount,
532 (mlip ? mlip->li_lsn : 0));
534 } else { 533 } else {
535 spin_unlock(&ailp->xa_lock); 534 spin_unlock(&ailp->xa_lock);
536 } 535 }
@@ -540,6 +539,8 @@ xfs_trans_delete_ail(
540 * If the file system is not being shutdown, we are in 539 * If the file system is not being shutdown, we are in
541 * serious trouble if we get to this stage. 540 * serious trouble if we get to this stage.
542 */ 541 */
542 struct xfs_mount *mp = ailp->xa_mount;
543
543 spin_unlock(&ailp->xa_lock); 544 spin_unlock(&ailp->xa_lock);
544 if (!XFS_FORCED_SHUTDOWN(mp)) { 545 if (!XFS_FORCED_SHUTDOWN(mp)) {
545 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp, 546 xfs_cmn_err(XFS_PTAG_AILDELETE, CE_ALERT, mp,