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_buf_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_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 793e53c01dc0..d245d04e10ca 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -375,7 +375,7 @@ xfs_buf_item_unpin( | |||
375 | xfs_buf_log_item_t *bip, | 375 | xfs_buf_log_item_t *bip, |
376 | int stale) | 376 | int stale) |
377 | { | 377 | { |
378 | xfs_mount_t *mp; | 378 | struct xfs_ail *ailp; |
379 | xfs_buf_t *bp; | 379 | xfs_buf_t *bp; |
380 | int freed; | 380 | int freed; |
381 | 381 | ||
@@ -387,7 +387,7 @@ xfs_buf_item_unpin( | |||
387 | xfs_buftrace("XFS_UNPIN", bp); | 387 | xfs_buftrace("XFS_UNPIN", bp); |
388 | 388 | ||
389 | freed = atomic_dec_and_test(&bip->bli_refcount); | 389 | freed = atomic_dec_and_test(&bip->bli_refcount); |
390 | mp = bip->bli_item.li_mountp; | 390 | ailp = bip->bli_item.li_ailp; |
391 | xfs_bunpin(bp); | 391 | xfs_bunpin(bp); |
392 | if (freed && stale) { | 392 | if (freed && stale) { |
393 | ASSERT(bip->bli_flags & XFS_BLI_STALE); | 393 | ASSERT(bip->bli_flags & XFS_BLI_STALE); |
@@ -399,17 +399,17 @@ xfs_buf_item_unpin( | |||
399 | xfs_buftrace("XFS_UNPIN STALE", bp); | 399 | xfs_buftrace("XFS_UNPIN STALE", bp); |
400 | /* | 400 | /* |
401 | * If we get called here because of an IO error, we may | 401 | * If we get called here because of an IO error, we may |
402 | * or may not have the item on the AIL. xfs_trans_delete_ail() | 402 | * or may not have the item on the AIL. xfs_trans_ail_delete() |
403 | * will take care of that situation. | 403 | * will take care of that situation. |
404 | * xfs_trans_delete_ail() drops the AIL lock. | 404 | * xfs_trans_ail_delete() drops the AIL lock. |
405 | */ | 405 | */ |
406 | if (bip->bli_flags & XFS_BLI_STALE_INODE) { | 406 | if (bip->bli_flags & XFS_BLI_STALE_INODE) { |
407 | xfs_buf_do_callbacks(bp, (xfs_log_item_t *)bip); | 407 | xfs_buf_do_callbacks(bp, (xfs_log_item_t *)bip); |
408 | XFS_BUF_SET_FSPRIVATE(bp, NULL); | 408 | XFS_BUF_SET_FSPRIVATE(bp, NULL); |
409 | XFS_BUF_CLR_IODONE_FUNC(bp); | 409 | XFS_BUF_CLR_IODONE_FUNC(bp); |
410 | } else { | 410 | } else { |
411 | spin_lock(&mp->m_ail->xa_lock); | 411 | spin_lock(&ailp->xa_lock); |
412 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); | 412 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip); |
413 | xfs_buf_item_relse(bp); | 413 | xfs_buf_item_relse(bp); |
414 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL); | 414 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL); |
415 | } | 415 | } |
@@ -1123,29 +1123,23 @@ xfs_buf_iodone( | |||
1123 | xfs_buf_t *bp, | 1123 | xfs_buf_t *bp, |
1124 | xfs_buf_log_item_t *bip) | 1124 | xfs_buf_log_item_t *bip) |
1125 | { | 1125 | { |
1126 | struct xfs_mount *mp; | 1126 | struct xfs_ail *ailp = bip->bli_item.li_ailp; |
1127 | struct xfs_ail *ailp; | ||
1128 | 1127 | ||
1129 | ASSERT(bip->bli_buf == bp); | 1128 | ASSERT(bip->bli_buf == bp); |
1130 | 1129 | ||
1131 | xfs_buf_rele(bp); | 1130 | xfs_buf_rele(bp); |
1132 | mp = bip->bli_item.li_mountp; | ||
1133 | ailp = bip->bli_item.li_ailp; | ||
1134 | 1131 | ||
1135 | /* | 1132 | /* |
1136 | * If we are forcibly shutting down, this may well be | 1133 | * If we are forcibly shutting down, this may well be |
1137 | * off the AIL already. That's because we simulate the | 1134 | * off the AIL already. That's because we simulate the |
1138 | * log-committed callbacks to unpin these buffers. Or we may never | 1135 | * log-committed callbacks to unpin these buffers. Or we may never |
1139 | * have put this item on AIL because of the transaction was | 1136 | * have put this item on AIL because of the transaction was |
1140 | * aborted forcibly. xfs_trans_delete_ail() takes care of these. | 1137 | * aborted forcibly. xfs_trans_ail_delete() takes care of these. |
1141 | * | 1138 | * |
1142 | * Either way, AIL is useless if we're forcing a shutdown. | 1139 | * Either way, AIL is useless if we're forcing a shutdown. |
1143 | */ | 1140 | */ |
1144 | spin_lock(&ailp->xa_lock); | 1141 | spin_lock(&ailp->xa_lock); |
1145 | /* | 1142 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip); |
1146 | * xfs_trans_delete_ail() drops the AIL lock. | ||
1147 | */ | ||
1148 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); | ||
1149 | xfs_buf_item_free(bip); | 1143 | xfs_buf_item_free(bip); |
1150 | } | 1144 | } |
1151 | 1145 | ||