Skip to content

Commit

Permalink
btrfs: tree-checker: get fs_info from eb in check_leaf_item
Browse files Browse the repository at this point in the history
We can read fs_info from extent buffer and can drop it from the
parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Apr 29, 2019
1 parent ae2a19d commit 0076bc8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/btrfs/tree-checker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0076bc8

Please sign in to comment.