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: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ae2a19d8ad
commit
0076bc89a7
@ -771,8 +771,7 @@ static int check_inode_item(struct btrfs_fs_info *fs_info,
|
|||||||
/*
|
/*
|
||||||
* Common point to switch the item-specific validation.
|
* Common point to switch the item-specific validation.
|
||||||
*/
|
*/
|
||||||
static int check_leaf_item(struct btrfs_fs_info *fs_info,
|
static int check_leaf_item(struct extent_buffer *leaf,
|
||||||
struct extent_buffer *leaf,
|
|
||||||
struct btrfs_key *key, int slot)
|
struct btrfs_key *key, int slot)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -795,14 +794,14 @@ static int check_leaf_item(struct btrfs_fs_info *fs_info,
|
|||||||
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(fs_info, leaf, chunk,
|
ret = btrfs_check_chunk_valid(leaf->fs_info, leaf, chunk,
|
||||||
key->offset);
|
key->offset);
|
||||||
break;
|
break;
|
||||||
case BTRFS_DEV_ITEM_KEY:
|
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;
|
break;
|
||||||
case BTRFS_INODE_ITEM_KEY:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
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
|
* Check if the item size and content meet other
|
||||||
* criteria
|
* criteria
|
||||||
*/
|
*/
|
||||||
ret = check_leaf_item(fs_info, leaf, &key, slot);
|
ret = check_leaf_item(leaf, &key, slot);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user