diff options
author | David Chinner <david@fromorbit.com> | 2008-10-30 02:39:00 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:39:00 -0400 |
commit | 5b00f14fbd60d42441f78c0e414a539cbfba5cb9 (patch) | |
tree | 6ecce1247c704666e2835883de73cb300c1b0693 /fs/xfs/xfs_log_recover.c | |
parent | 27d8d5fe0ef9daeaafbdd32b14b32a2211930062 (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.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 37ba4899f3e6..45ea0d950138 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -2728,8 +2728,7 @@ xlog_recover_do_efd_trans( | |||
2728 | */ | 2728 | */ |
2729 | mp = log->l_mp; | 2729 | mp = log->l_mp; |
2730 | spin_lock(&mp->m_ail_lock); | 2730 | spin_lock(&mp->m_ail_lock); |
2731 | xfs_trans_ail_cursor_init(mp->m_ail, &cur); | 2731 | lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0); |
2732 | lip = xfs_trans_first_ail(mp, &cur); | ||
2733 | while (lip != NULL) { | 2732 | while (lip != NULL) { |
2734 | if (lip->li_type == XFS_LI_EFI) { | 2733 | if (lip->li_type == XFS_LI_EFI) { |
2735 | efip = (xfs_efi_log_item_t *)lip; | 2734 | efip = (xfs_efi_log_item_t *)lip; |
@@ -2744,7 +2743,7 @@ xlog_recover_do_efd_trans( | |||
2744 | break; | 2743 | break; |
2745 | } | 2744 | } |
2746 | } | 2745 | } |
2747 | lip = xfs_trans_next_ail(mp, &cur); | 2746 | lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur); |
2748 | } | 2747 | } |
2749 | xfs_trans_ail_cursor_done(mp->m_ail, &cur); | 2748 | xfs_trans_ail_cursor_done(mp->m_ail, &cur); |
2750 | spin_unlock(&mp->m_ail_lock); | 2749 | spin_unlock(&mp->m_ail_lock); |
@@ -3061,8 +3060,7 @@ xlog_recover_process_efis( | |||
3061 | mp = log->l_mp; | 3060 | mp = log->l_mp; |
3062 | spin_lock(&mp->m_ail_lock); | 3061 | spin_lock(&mp->m_ail_lock); |
3063 | 3062 | ||
3064 | xfs_trans_ail_cursor_init(mp->m_ail, &cur); | 3063 | lip = xfs_trans_ail_cursor_first(mp->m_ail, &cur, 0); |
3065 | lip = xfs_trans_first_ail(mp, &cur); | ||
3066 | while (lip != NULL) { | 3064 | while (lip != NULL) { |
3067 | /* | 3065 | /* |
3068 | * We're done when we see something other than an EFI. | 3066 | * We're done when we see something other than an EFI. |
@@ -3070,7 +3068,8 @@ xlog_recover_process_efis( | |||
3070 | */ | 3068 | */ |
3071 | if (lip->li_type != XFS_LI_EFI) { | 3069 | if (lip->li_type != XFS_LI_EFI) { |
3072 | #ifdef DEBUG | 3070 | #ifdef DEBUG |
3073 | for (; lip; lip = xfs_trans_next_ail(mp, &cur)) | 3071 | for (; lip; |
3072 | lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur)) | ||
3074 | ASSERT(lip->li_type != XFS_LI_EFI); | 3073 | ASSERT(lip->li_type != XFS_LI_EFI); |
3075 | #endif | 3074 | #endif |
3076 | break; | 3075 | break; |
@@ -3081,7 +3080,7 @@ xlog_recover_process_efis( | |||
3081 | */ | 3080 | */ |
3082 | efip = (xfs_efi_log_item_t *)lip; | 3081 | efip = (xfs_efi_log_item_t *)lip; |
3083 | if (efip->efi_flags & XFS_EFI_RECOVERED) { | 3082 | if (efip->efi_flags & XFS_EFI_RECOVERED) { |
3084 | lip = xfs_trans_next_ail(mp, &cur); | 3083 | lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur); |
3085 | continue; | 3084 | continue; |
3086 | } | 3085 | } |
3087 | 3086 | ||
@@ -3090,7 +3089,7 @@ xlog_recover_process_efis( | |||
3090 | spin_lock(&mp->m_ail_lock); | 3089 | spin_lock(&mp->m_ail_lock); |
3091 | if (error) | 3090 | if (error) |
3092 | goto out; | 3091 | goto out; |
3093 | lip = xfs_trans_next_ail(mp, &cur); | 3092 | lip = xfs_trans_ail_cursor_next(mp->m_ail, &cur); |
3094 | } | 3093 | } |
3095 | out: | 3094 | out: |
3096 | xfs_trans_ail_cursor_done(mp->m_ail, &cur); | 3095 | xfs_trans_ail_cursor_done(mp->m_ail, &cur); |