mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-12-11 13:13:24 +08:00
btrfs-progs: Change btrfs_root to btrfs_fs_info argument in btrfs_lookup_extent_info
That function really wants an fs_info and not a root. Accidentally, this also makes the kernel/user space signatures to be coherent. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
12e2280d7b
commit
a22b593587
10
check/main.c
10
check/main.c
@ -1622,9 +1622,9 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
|
||||
refs = nrefs->refs[*level];
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = btrfs_lookup_extent_info(NULL, root,
|
||||
path->nodes[*level]->start,
|
||||
*level, 1, &refs, NULL);
|
||||
ret = btrfs_lookup_extent_info(NULL, fs_info,
|
||||
path->nodes[*level]->start,
|
||||
*level, 1, &refs, NULL);
|
||||
if (ret < 0) {
|
||||
err = ret;
|
||||
goto out;
|
||||
@ -1664,7 +1664,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
|
||||
if (bytenr == nrefs->bytenr[*level - 1]) {
|
||||
refs = nrefs->refs[*level - 1];
|
||||
} else {
|
||||
ret = btrfs_lookup_extent_info(NULL, root, bytenr,
|
||||
ret = btrfs_lookup_extent_info(NULL, fs_info, bytenr,
|
||||
*level - 1, 1, &refs, NULL);
|
||||
if (ret < 0) {
|
||||
refs = 0;
|
||||
@ -5928,7 +5928,7 @@ static int run_next_block(struct btrfs_root *root,
|
||||
|
||||
flags = 0;
|
||||
if (!init_extent_tree) {
|
||||
ret = btrfs_lookup_extent_info(NULL, root, bytenr,
|
||||
ret = btrfs_lookup_extent_info(NULL, fs_info, bytenr,
|
||||
btrfs_header_level(buf), 1, NULL,
|
||||
&flags);
|
||||
if (ret < 0) {
|
||||
|
@ -186,8 +186,8 @@ static int update_nodes_refs(struct btrfs_root *root, u64 bytenr,
|
||||
|
||||
if (bytenr != (u64)-1) {
|
||||
/* the return value of this function seems a mistake */
|
||||
ret = btrfs_lookup_extent_info(NULL, root, bytenr,
|
||||
level, 1, &refs, &flags);
|
||||
ret = btrfs_lookup_extent_info(NULL, root->fs_info, bytenr,
|
||||
level, 1, &refs, &flags);
|
||||
/* temporary fix */
|
||||
if (ret < 0 && !check_all)
|
||||
return ret;
|
||||
|
3
ctree.c
3
ctree.c
@ -192,7 +192,8 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
|
||||
*/
|
||||
|
||||
if (btrfs_block_can_be_shared(root, buf)) {
|
||||
ret = btrfs_lookup_extent_info(trans, root, buf->start,
|
||||
ret = btrfs_lookup_extent_info(trans, trans->fs_info,
|
||||
buf->start,
|
||||
btrfs_header_level(buf), 1,
|
||||
&refs, &flags);
|
||||
BUG_ON(ret);
|
||||
|
2
ctree.h
2
ctree.h
@ -2517,7 +2517,7 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_disk_key *key, int level,
|
||||
u64 hint, u64 empty_size);
|
||||
int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 bytenr,
|
||||
struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
u64 offset, int metadata, u64 *refs, u64 *flags);
|
||||
int btrfs_set_block_flags(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
|
@ -1434,7 +1434,7 @@ int btrfs_extent_post_op(struct btrfs_trans_handle *trans)
|
||||
}
|
||||
|
||||
int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 bytenr,
|
||||
struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
u64 offset, int metadata, u64 *refs, u64 *flags)
|
||||
{
|
||||
struct btrfs_path *path;
|
||||
@ -1446,9 +1446,8 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
|
||||
u64 num_refs;
|
||||
u64 extent_flags;
|
||||
|
||||
if (metadata &&
|
||||
!btrfs_fs_incompat(root->fs_info, SKINNY_METADATA)) {
|
||||
offset = root->fs_info->nodesize;
|
||||
if (metadata && !btrfs_fs_incompat(fs_info, SKINNY_METADATA)) {
|
||||
offset = fs_info->nodesize;
|
||||
metadata = 0;
|
||||
}
|
||||
|
||||
@ -1465,8 +1464,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
|
||||
key.type = BTRFS_EXTENT_ITEM_KEY;
|
||||
|
||||
again:
|
||||
ret = btrfs_search_slot(trans, root->fs_info->extent_root, &key, path,
|
||||
0, 0);
|
||||
ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
@ -1483,14 +1481,14 @@ again:
|
||||
path->slots[0]);
|
||||
if (key.objectid == bytenr &&
|
||||
key.type == BTRFS_EXTENT_ITEM_KEY &&
|
||||
key.offset == root->fs_info->nodesize)
|
||||
key.offset == fs_info->nodesize)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
btrfs_release_path(path);
|
||||
key.type = BTRFS_EXTENT_ITEM_KEY;
|
||||
key.offset = root->fs_info->nodesize;
|
||||
key.offset = fs_info->nodesize;
|
||||
metadata = 0;
|
||||
goto again;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user