aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2012-05-16 11:04:52 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2012-05-26 06:17:53 -0400
commit5581a51a59a1f5f51ac3d4bacafb738d35e0350b (patch)
treed7e291e139d08f2be7870c9da602658df8f51ce8 /fs/btrfs/extent-tree.c
parent976b1908d97bd8cbd024ba7aafaa3fb637ea8e13 (diff)
Btrfs: don't set for_cow parameter for tree block functions
Three callers of btrfs_free_tree_block or btrfs_alloc_tree_block passed parameter for_cow = 1. In fact, these two functions should never mark their tree modification operations as for_cow, because they can change the number of blocks referenced by a tree. Hence, we remove the extra for_cow parameter from these functions and make them pass a zero down. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 49fd7b66d57b..b68eb7ad05a7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5217,7 +5217,7 @@ out:
5217void btrfs_free_tree_block(struct btrfs_trans_handle *trans, 5217void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
5218 struct btrfs_root *root, 5218 struct btrfs_root *root,
5219 struct extent_buffer *buf, 5219 struct extent_buffer *buf,
5220 u64 parent, int last_ref, int for_cow) 5220 u64 parent, int last_ref)
5221{ 5221{
5222 struct btrfs_block_group_cache *cache = NULL; 5222 struct btrfs_block_group_cache *cache = NULL;
5223 int ret; 5223 int ret;
@@ -5227,7 +5227,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
5227 buf->start, buf->len, 5227 buf->start, buf->len,
5228 parent, root->root_key.objectid, 5228 parent, root->root_key.objectid,
5229 btrfs_header_level(buf), 5229 btrfs_header_level(buf),
5230 BTRFS_DROP_DELAYED_REF, NULL, for_cow); 5230 BTRFS_DROP_DELAYED_REF, NULL, 0);
5231 BUG_ON(ret); /* -ENOMEM */ 5231 BUG_ON(ret); /* -ENOMEM */
5232 } 5232 }
5233 5233
@@ -6249,7 +6249,7 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
6249 struct btrfs_root *root, u32 blocksize, 6249 struct btrfs_root *root, u32 blocksize,
6250 u64 parent, u64 root_objectid, 6250 u64 parent, u64 root_objectid,
6251 struct btrfs_disk_key *key, int level, 6251 struct btrfs_disk_key *key, int level,
6252 u64 hint, u64 empty_size, int for_cow) 6252 u64 hint, u64 empty_size)
6253{ 6253{
6254 struct btrfs_key ins; 6254 struct btrfs_key ins;
6255 struct btrfs_block_rsv *block_rsv; 6255 struct btrfs_block_rsv *block_rsv;
@@ -6297,7 +6297,7 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
6297 ins.objectid, 6297 ins.objectid,
6298 ins.offset, parent, root_objectid, 6298 ins.offset, parent, root_objectid,
6299 level, BTRFS_ADD_DELAYED_EXTENT, 6299 level, BTRFS_ADD_DELAYED_EXTENT,
6300 extent_op, for_cow); 6300 extent_op, 0);
6301 BUG_ON(ret); /* -ENOMEM */ 6301 BUG_ON(ret); /* -ENOMEM */
6302 } 6302 }
6303 return buf; 6303 return buf;
@@ -6715,7 +6715,7 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
6715 btrfs_header_owner(path->nodes[level + 1])); 6715 btrfs_header_owner(path->nodes[level + 1]));
6716 } 6716 }
6717 6717
6718 btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1, 0); 6718 btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1);
6719out: 6719out:
6720 wc->refs[level] = 0; 6720 wc->refs[level] = 0;
6721 wc->flags[level] = 0; 6721 wc->flags[level] = 0;