mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-13 17:21:05 +00:00
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
95d3f20b51
("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>
This commit is contained in:
parent
2c6e4834c3
commit
f23d10d9c0
4
ctree.c
4
ctree.c
@ -334,7 +334,7 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans,
|
||||
WARN_ON(btrfs_header_generation(parent) != trans->transid);
|
||||
|
||||
btrfs_free_extent(trans, root, buf->start, buf->len,
|
||||
0, root->root_key.objectid, level, 1);
|
||||
0, root->root_key.objectid, level, 0);
|
||||
}
|
||||
if (!list_empty(&buf->recow)) {
|
||||
list_del_init(&buf->recow);
|
||||
@ -738,7 +738,7 @@ static int balance_level(struct btrfs_trans_handle *trans,
|
||||
|
||||
ret = btrfs_free_extent(trans, root, mid->start, mid->len,
|
||||
0, root->root_key.objectid,
|
||||
level, 1);
|
||||
level, 0);
|
||||
/* once for the root ptr */
|
||||
free_extent_buffer(mid);
|
||||
return ret;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user