Commit 0076bc89 authored by David Sterba's avatar David Sterba

btrfs: tree-checker: get fs_info from eb in check_leaf_item

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 ae2a19d8
......@@ -771,8 +771,7 @@ static int check_inode_item(struct btrfs_fs_info *fs_info,
/*
* Common point to switch the item-specific validation.
*/
static int check_leaf_item(struct btrfs_fs_info *fs_info,
struct extent_buffer *leaf,
static int check_leaf_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{
int ret = 0;
......@@ -795,14 +794,14 @@ static int check_leaf_item(struct btrfs_fs_info *fs_info,
break;
case BTRFS_CHUNK_ITEM_KEY:
chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
ret = btrfs_check_chunk_valid(fs_info, leaf, chunk,
ret = btrfs_check_chunk_valid(leaf->fs_info, leaf, chunk,
key->offset);
break;
case BTRFS_DEV_ITEM_KEY:
ret = check_dev_item(fs_info, leaf, key, slot);
ret = check_dev_item(leaf->fs_info, leaf, key, slot);
break;
case BTRFS_INODE_ITEM_KEY:
ret = check_inode_item(fs_info, leaf, key, slot);
ret = check_inode_item(leaf->fs_info, leaf, key, slot);
break;
}
return ret;
......@@ -952,7 +951,7 @@ static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
* Check if the item size and content meet other
* criteria
*/
ret = check_leaf_item(fs_info, leaf, &key, slot);
ret = check_leaf_item(leaf, &key, slot);
if (ret < 0)
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