summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 17:39:00 +1100
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 17:39:00 +1100
commit5b00f14fbd60d42441f78c0e414a539cbfba5cb9 (patch)
tree6ecce1247c704666e2835883de73cb300c1b0693 /fs/xfs/xfs_log_recover.c
parent27d8d5fe0ef9daeaafbdd32b14b32a2211930062 (diff)
[XFS] move the AIl traversal over to a consistent interface
With the new cursor interface, it makes sense to make all the traversing code use the cursor interface and make the old one go away. This means more of the AIL interfacing is done by passing struct xfs_ail pointers around the place instead of struct xfs_mount pointers. We can replace the use of xfs_trans_first_ail() in xfs_log_need_covered() as it is only checking if the AIL is empty. We can do that with a call to xfs_trans_ail_tail() instead, where a zero LSN returned indicates and empty AIL... SGI-PV: 988143 SGI-Modid: xfs-linux-melb:xfs-kern:32348a 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_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 37ba4899f3e..45ea0d95013 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2728,8 +2728,7 @@ xlog_recover_do_efd_trans(
*/
mp = log->l_mp;
spin_lock(&mp->m_ail_lock);
- xfs_trans_ail_cursor_init(mp->m_ail, &cur);
- lip = xfs_trans_first_ail(mp, &cur);
+ lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0);
while (lip != NULL) {
if (lip->li_type == XFS_LI_EFI) {
efip = (xfs_efi_log_item_t *)lip;
@@ -2744,7 +2743,7 @@ xlog_recover_do_efd_trans(
break;
}
}
- lip = xfs_trans_next_ail(mp, &cur);
+ lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
}
xfs_trans_ail_cursor_done(mp->m_ail, &cur);
spin_unlock(&mp->m_ail_lock);
@@ -3061,8 +3060,7 @@ xlog_recover_process_efis(
mp = log->l_mp;
spin_lock(&mp->m_ail_lock);
- xfs_trans_ail_cursor_init(mp->m_ail, &cur);
- lip = xfs_trans_first_ail(mp, &cur);
+ lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0);
while (lip != NULL) {
/*
* We're done when we see something other than an EFI.
@@ -3070,7 +3068,8 @@ xlog_recover_process_efis(
*/
if (lip->li_type != XFS_LI_EFI) {
#ifdef DEBUG
- for (; lip; lip = xfs_trans_next_ail(mp, &cur))
+ for (; lip;
+ lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur))
ASSERT(lip->li_type != XFS_LI_EFI);
#endif
break;
@@ -3081,7 +3080,7 @@ xlog_recover_process_efis(
*/
efip = (xfs_efi_log_item_t *)lip;
if (efip->efi_flags & XFS_EFI_RECOVERED) {
- lip = xfs_trans_next_ail(mp, &cur);
+ lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
continue;
}
@@ -3090,7 +3089,7 @@ xlog_recover_process_efis(
spin_lock(&mp->m_ail_lock);
if (error)
goto out;
- lip = xfs_trans_next_ail(mp, &cur);
+ lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur);
}
out:
xfs_trans_ail_cursor_done(mp->m_ail, &cur);