diff options
author | David Chinner <david@fromorbit.com> | 2008-10-30 02:39:58 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:39:58 -0400 |
commit | 783a2f656f9674c31d4019708a94af93fa1d1c22 (patch) | |
tree | 7ac2123b187c0522dbd8a0d94de3856b33147c46 /fs/xfs/xfs_extfree_item.c | |
parent | fc1829f34d30899701dfd5890030d39e13e1f47d (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_extfree_item.c')
-rw-r--r-- | fs/xfs/xfs_extfree_item.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index dab57374e1fe..05a4bdd4be39 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c | |||
@@ -108,17 +108,12 @@ xfs_efi_item_pin(xfs_efi_log_item_t *efip) | |||
108 | STATIC void | 108 | STATIC void |
109 | xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale) | 109 | xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale) |
110 | { | 110 | { |
111 | xfs_mount_t *mp; | 111 | struct xfs_ail *ailp = efip->efi_item.li_ailp; |
112 | struct xfs_ail *ailp; | ||
113 | 112 | ||
114 | mp = efip->efi_item.li_mountp; | ||
115 | ailp = efip->efi_item.li_ailp; | ||
116 | spin_lock(&ailp->xa_lock); | 113 | spin_lock(&ailp->xa_lock); |
117 | if (efip->efi_flags & XFS_EFI_CANCELED) { | 114 | if (efip->efi_flags & XFS_EFI_CANCELED) { |
118 | /* | 115 | /* xfs_trans_ail_delete() drops the AIL lock. */ |
119 | * xfs_trans_delete_ail() drops the AIL lock. | 116 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)efip); |
120 | */ | ||
121 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip); | ||
122 | xfs_efi_item_free(efip); | 117 | xfs_efi_item_free(efip); |
123 | } else { | 118 | } else { |
124 | efip->efi_flags |= XFS_EFI_COMMITTED; | 119 | efip->efi_flags |= XFS_EFI_COMMITTED; |
@@ -136,12 +131,9 @@ xfs_efi_item_unpin(xfs_efi_log_item_t *efip, int stale) | |||
136 | STATIC void | 131 | STATIC void |
137 | xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp) | 132 | xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp) |
138 | { | 133 | { |
139 | xfs_mount_t *mp; | 134 | struct xfs_ail *ailp = efip->efi_item.li_ailp; |
140 | struct xfs_ail *ailp; | ||
141 | xfs_log_item_desc_t *lidp; | 135 | xfs_log_item_desc_t *lidp; |
142 | 136 | ||
143 | mp = efip->efi_item.li_mountp; | ||
144 | ailp = efip->efi_item.li_ailp; | ||
145 | spin_lock(&ailp->xa_lock); | 137 | spin_lock(&ailp->xa_lock); |
146 | if (efip->efi_flags & XFS_EFI_CANCELED) { | 138 | if (efip->efi_flags & XFS_EFI_CANCELED) { |
147 | /* | 139 | /* |
@@ -149,11 +141,9 @@ xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp) | |||
149 | */ | 141 | */ |
150 | lidp = xfs_trans_find_item(tp, (xfs_log_item_t *) efip); | 142 | lidp = xfs_trans_find_item(tp, (xfs_log_item_t *) efip); |
151 | xfs_trans_free_item(tp, lidp); | 143 | xfs_trans_free_item(tp, lidp); |
152 | /* | 144 | |
153 | * pull the item off the AIL. | 145 | /* xfs_trans_ail_delete() drops the AIL lock. */ |
154 | * xfs_trans_delete_ail() drops the AIL lock. | 146 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)efip); |
155 | */ | ||
156 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip); | ||
157 | xfs_efi_item_free(efip); | 147 | xfs_efi_item_free(efip); |
158 | } else { | 148 | } else { |
159 | efip->efi_flags |= XFS_EFI_COMMITTED; | 149 | efip->efi_flags |= XFS_EFI_COMMITTED; |
@@ -350,12 +340,9 @@ void | |||
350 | xfs_efi_release(xfs_efi_log_item_t *efip, | 340 | xfs_efi_release(xfs_efi_log_item_t *efip, |
351 | uint nextents) | 341 | uint nextents) |
352 | { | 342 | { |
353 | xfs_mount_t *mp; | 343 | struct xfs_ail *ailp = efip->efi_item.li_ailp; |
354 | struct xfs_ail *ailp; | ||
355 | int extents_left; | 344 | int extents_left; |
356 | 345 | ||
357 | mp = efip->efi_item.li_mountp; | ||
358 | ailp = efip->efi_item.li_ailp; | ||
359 | ASSERT(efip->efi_next_extent > 0); | 346 | ASSERT(efip->efi_next_extent > 0); |
360 | ASSERT(efip->efi_flags & XFS_EFI_COMMITTED); | 347 | ASSERT(efip->efi_flags & XFS_EFI_COMMITTED); |
361 | 348 | ||
@@ -364,10 +351,8 @@ xfs_efi_release(xfs_efi_log_item_t *efip, | |||
364 | efip->efi_next_extent -= nextents; | 351 | efip->efi_next_extent -= nextents; |
365 | extents_left = efip->efi_next_extent; | 352 | extents_left = efip->efi_next_extent; |
366 | if (extents_left == 0) { | 353 | if (extents_left == 0) { |
367 | /* | 354 | /* xfs_trans_ail_delete() drops the AIL lock. */ |
368 | * xfs_trans_delete_ail() drops the AIL lock. | 355 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)efip); |
369 | */ | ||
370 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip); | ||
371 | xfs_efi_item_free(efip); | 356 | xfs_efi_item_free(efip); |
372 | } else { | 357 | } else { |
373 | spin_unlock(&ailp->xa_lock); | 358 | spin_unlock(&ailp->xa_lock); |