aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.yan@oracle.com>2010-05-16 10:46:25 -0400
committerChris Mason <chris.mason@oracle.com>2010-05-25 10:34:50 -0400
commitf0486c68e4bd9a06a5904d3eeb3a0d73a83befb8 (patch)
tree509428ef400ef45e875a3c448b63b86cbea36aea /fs/btrfs/transaction.c
parent2ead6ae770d9f9dec9f4286bf0fd9001b4388c4b (diff)
Btrfs: Introduce contexts for metadata reservation
Introducing metadata reseravtion contexts has two major advantages. First, it makes metadata reseravtion more traceable. Second, it can reclaim freed space and re-add them to the itself after transaction committed. Besides add btrfs_block_rsv structure and related helper functions, This patch contains following changes: Move code that decides if freed tree block should be pinned into btrfs_free_tree_block(). Make space accounting more accurate, mainly for handling read only block groups. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 2cb116099b90..21ad37c05199 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -185,9 +185,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
185 h->blocks_reserved = num_blocks; 185 h->blocks_reserved = num_blocks;
186 h->blocks_used = 0; 186 h->blocks_used = 0;
187 h->block_group = 0; 187 h->block_group = 0;
188 h->alloc_exclude_nr = 0;
189 h->alloc_exclude_start = 0;
190 h->delayed_ref_updates = 0; 188 h->delayed_ref_updates = 0;
189 h->block_rsv = NULL;
191 190
192 if (!current->journal_info && type != TRANS_USERSPACE) 191 if (!current->journal_info && type != TRANS_USERSPACE)
193 current->journal_info = h; 192 current->journal_info = h;