diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-04-24 15:06:16 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-04-28 14:18:04 -0400 |
commit | 97d3ac75e5e0ebf7ca38ae74cebd201c09b97ab2 (patch) | |
tree | e08af7a4bbb93c22dfeb1bcb2d3caf83aef717c9 /fs/xfs/xfs_alloc_btree.c | |
parent | e26f0501cf743a4289603501413f97ffcb4612f2 (diff) |
xfs: exact busy extent tracking
Update the extent tree in case we have to reuse a busy extent, so that it
always is kept uptodate. This is done by replacing the busy list searches
with a new xfs_alloc_busy_reuse helper, which updates the busy extent tree
in case of a reuse. This allows us to allow reusing metadata extents
unconditionally, and thus avoid log forces especially for allocation btree
blocks.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_alloc_btree.c')
-rw-r--r-- | fs/xfs/xfs_alloc_btree.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c index bcfe92f47edd..8b469d53599f 100644 --- a/fs/xfs/xfs_alloc_btree.c +++ b/fs/xfs/xfs_alloc_btree.c | |||
@@ -94,8 +94,8 @@ xfs_allocbt_alloc_block( | |||
94 | *stat = 0; | 94 | *stat = 0; |
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | if (xfs_alloc_busy_search(cur->bc_mp, cur->bc_private.a.agno, bno, 1)) | 97 | |
98 | xfs_trans_set_sync(cur->bc_tp); | 98 | xfs_alloc_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false); |
99 | 99 | ||
100 | xfs_trans_agbtree_delta(cur->bc_tp, 1); | 100 | xfs_trans_agbtree_delta(cur->bc_tp, 1); |
101 | new->s = cpu_to_be32(bno); | 101 | new->s = cpu_to_be32(bno); |
@@ -120,17 +120,6 @@ xfs_allocbt_free_block( | |||
120 | if (error) | 120 | if (error) |
121 | return error; | 121 | return error; |
122 | 122 | ||
123 | /* | ||
124 | * Since blocks move to the free list without the coordination used in | ||
125 | * xfs_bmap_finish, we can't allow block to be available for | ||
126 | * reallocation and non-transaction writing (user data) until we know | ||
127 | * that the transaction that moved it to the free list is permanently | ||
128 | * on disk. We track the blocks by declaring these blocks as "busy"; | ||
129 | * the busy list is maintained on a per-ag basis and each transaction | ||
130 | * records which entries should be removed when the iclog commits to | ||
131 | * disk. If a busy block is allocated, the iclog is pushed up to the | ||
132 | * LSN that freed the block. | ||
133 | */ | ||
134 | xfs_alloc_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); | 123 | xfs_alloc_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); |
135 | xfs_trans_agbtree_delta(cur->bc_tp, -1); | 124 | xfs_trans_agbtree_delta(cur->bc_tp, -1); |
136 | return 0; | 125 | return 0; |