mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-22 12:33:59 +08:00
btrfs: get fs_info from eb in read_one_chunk
We can read fs_info from extent buffer and can drop it from the parameters. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ddaf1d5aef
commit
9690ac0987
@ -6686,10 +6686,10 @@ static u64 calc_stripe_length(u64 type, u64 chunk_len, int num_stripes)
|
|||||||
return div_u64(chunk_len, data_stripes);
|
return div_u64(chunk_len, data_stripes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key,
|
static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf,
|
||||||
struct extent_buffer *leaf,
|
|
||||||
struct btrfs_chunk *chunk)
|
struct btrfs_chunk *chunk)
|
||||||
{
|
{
|
||||||
|
struct btrfs_fs_info *fs_info = leaf->fs_info;
|
||||||
struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
|
struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
|
||||||
struct map_lookup *map;
|
struct map_lookup *map;
|
||||||
struct extent_map *em;
|
struct extent_map *em;
|
||||||
@ -7069,7 +7069,7 @@ int btrfs_read_sys_array(struct btrfs_fs_info *fs_info)
|
|||||||
if (cur_offset + len > array_size)
|
if (cur_offset + len > array_size)
|
||||||
goto out_short_read;
|
goto out_short_read;
|
||||||
|
|
||||||
ret = read_one_chunk(fs_info, &key, sb, chunk);
|
ret = read_one_chunk(&key, sb, chunk);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -7217,7 +7217,7 @@ int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info)
|
|||||||
} else if (found_key.type == BTRFS_CHUNK_ITEM_KEY) {
|
} else if (found_key.type == BTRFS_CHUNK_ITEM_KEY) {
|
||||||
struct btrfs_chunk *chunk;
|
struct btrfs_chunk *chunk;
|
||||||
chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
|
chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
|
||||||
ret = read_one_chunk(fs_info, &found_key, leaf, chunk);
|
ret = read_one_chunk(&found_key, leaf, chunk);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user