summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-06-08 15:47:52 +0300
committerDavid Sterba <dsterba@suse.com>2018-08-06 15:02:04 +0200
commitf23d10d9c052fcc1c1485392edfe19ebf14c634f (patch)
tree9f8b802d99e61a4bd2c6dbb7ca4de62171ef252e /extent-tree.c
parent2c6e4834c326f180fb413fe402d09556e03b7789 (diff)
btrfs-progs: Always pass 0 for offset when calling btrfs_free_extent for btree blocks.
Currently some instances of btrfs_free_extent are called with the last parameter ("offset") being set to 1. This makes no sense, since offset is used for data extents. I suspect this is a left-over from 95d3f20b51e9 ("Mixed back reference (FORWARD ROLLING FORMAT CHANGE)") since this commit changed the signature of the function from : -int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root - *root, u64 bytenr, u64 num_bytes, u64 parent, - u64 root_objectid, u64 ref_generation, - u64 owner_objectid, int pin); to +int btrfs_free_extent(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + u64 bytenr, u64 num_bytes, u64 parent, + u64 root_objectid, u64 owner, u64 offset); I.e the last parameter was "pin" and not offset. So these are just leftovers with no semantic meaning. Fix this by passing 0. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 1d558e5..5d49af5 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2961,7 +2961,7 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
path->slots[*level]++;
ret = btrfs_free_extent(trans, root, bytenr, blocksize,
parent->start, root_owner,
- root_gen, *level - 1, 1);
+ root_gen, *level - 1, 0);
BUG_ON(ret);
continue;
}
@@ -3003,7 +3003,7 @@ out:
root_gen = btrfs_header_generation(parent);
ret = btrfs_free_extent(trans, root, path->nodes[*level]->start,
path->nodes[*level]->len, parent->start,
- root_owner, root_gen, *level, 1);
+ root_owner, root_gen, *level, 0);
free_extent_buffer(path->nodes[*level]);
path->nodes[*level] = NULL;
*level += 1;
@@ -3054,7 +3054,7 @@ static int noinline walk_up_tree(struct btrfs_trans_handle *trans,
path->nodes[*level]->start,
path->nodes[*level]->len,
parent->start, root_owner,
- root_gen, *level, 1);
+ root_gen, *level, 0);
BUG_ON(ret);
free_extent_buffer(path->nodes[*level]);
path->nodes[*level] = NULL;