Commit ddaf1d5a authored by David Sterba's avatar David Sterba

btrfs: get fs_info from eb in btrfs_check_chunk_valid

We can read fs_info from extent buffer and can drop it from the
parameters.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6ec0896c
...@@ -498,10 +498,10 @@ static void chunk_err(const struct extent_buffer *leaf, ...@@ -498,10 +498,10 @@ static void chunk_err(const struct extent_buffer *leaf,
* Return -EUCLEAN if anything is corrupted. * Return -EUCLEAN if anything is corrupted.
* Return 0 if everything is OK. * Return 0 if everything is OK.
*/ */
int btrfs_check_chunk_valid(struct btrfs_fs_info *fs_info, int btrfs_check_chunk_valid(struct extent_buffer *leaf,
struct extent_buffer *leaf,
struct btrfs_chunk *chunk, u64 logical) struct btrfs_chunk *chunk, u64 logical)
{ {
struct btrfs_fs_info *fs_info = leaf->fs_info;
u64 length; u64 length;
u64 stripe_len; u64 stripe_len;
u16 num_stripes; u16 num_stripes;
...@@ -793,8 +793,7 @@ static int check_leaf_item(struct extent_buffer *leaf, ...@@ -793,8 +793,7 @@ static int check_leaf_item(struct extent_buffer *leaf,
break; break;
case BTRFS_CHUNK_ITEM_KEY: case BTRFS_CHUNK_ITEM_KEY:
chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
ret = btrfs_check_chunk_valid(leaf->fs_info, leaf, chunk, ret = btrfs_check_chunk_valid(leaf, chunk, key->offset);
key->offset);
break; break;
case BTRFS_DEV_ITEM_KEY: case BTRFS_DEV_ITEM_KEY:
ret = check_dev_item(leaf, key, slot); ret = check_dev_item(leaf, key, slot);
......
...@@ -23,8 +23,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf); ...@@ -23,8 +23,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf);
int btrfs_check_leaf_relaxed(struct extent_buffer *leaf); int btrfs_check_leaf_relaxed(struct extent_buffer *leaf);
int btrfs_check_node(struct extent_buffer *node); int btrfs_check_node(struct extent_buffer *node);
int btrfs_check_chunk_valid(struct btrfs_fs_info *fs_info, int btrfs_check_chunk_valid(struct extent_buffer *leaf,
struct extent_buffer *leaf,
struct btrfs_chunk *chunk, u64 logical); struct btrfs_chunk *chunk, u64 logical);
#endif #endif
...@@ -6710,7 +6710,7 @@ static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key, ...@@ -6710,7 +6710,7 @@ static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key,
* as chunk item in tree block is already verified by tree-checker. * as chunk item in tree block is already verified by tree-checker.
*/ */
if (leaf->start == BTRFS_SUPER_INFO_OFFSET) { if (leaf->start == BTRFS_SUPER_INFO_OFFSET) {
ret = btrfs_check_chunk_valid(fs_info, leaf, chunk, logical); ret = btrfs_check_chunk_valid(leaf, chunk, logical);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment