diff options
author | Arne Jansen <sensille@gmx.net> | 2011-09-12 09:26:38 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-12-22 10:22:27 -0500 |
commit | 66d7e7f09f77456fe68683247d77721032a00ee5 (patch) | |
tree | bbf7df3933ed47aa202d60d835864543d25df82d /fs/btrfs/disk-io.c | |
parent | c7d22a3c3cdb73d8a0151e2ccc8cf4a48c48310b (diff) |
Btrfs: mark delayed refs as for cow
Add a for_cow parameter to add_delayed_*_ref and pass the appropriate value
from every call site. The for_cow parameter will later on be used to
determine if a ref will change anything with respect to qgroups.
Delayed refs coming from relocation are always counted as for_cow, as they
don't change subvol quota.
Also pass in the fs_info for later use.
btrfs_find_all_roots() will use this as an optimization, as changes that are
for_cow will not change anything with respect to which root points to a
certain leaf. Thus, we don't need to add the current sequence number to
those delayed refs.
Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 94abc25392f6..6f8cd17c9a9f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1243,7 +1243,8 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans, | |||
1243 | root->ref_cows = 0; | 1243 | root->ref_cows = 0; |
1244 | 1244 | ||
1245 | leaf = btrfs_alloc_free_block(trans, root, root->leafsize, 0, | 1245 | leaf = btrfs_alloc_free_block(trans, root, root->leafsize, 0, |
1246 | BTRFS_TREE_LOG_OBJECTID, NULL, 0, 0, 0); | 1246 | BTRFS_TREE_LOG_OBJECTID, NULL, |
1247 | 0, 0, 0, 0); | ||
1247 | if (IS_ERR(leaf)) { | 1248 | if (IS_ERR(leaf)) { |
1248 | kfree(root); | 1249 | kfree(root); |
1249 | return ERR_CAST(leaf); | 1250 | return ERR_CAST(leaf); |