btrfs: tree-checker: get fs_info from eb in check_extent_data_item
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 15:21:10 +0000 (16:21 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:34 +0000 (19:02 +0200)
We can read fs_info from extent buffer and can drop it from the
parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-checker.c

index 9513ffd734536e1808309acddbac7b8f02c10dea..c5dd7adea306746c52900e091b4bb52f9bee349c 100644 (file)
@@ -104,10 +104,10 @@ static void file_extent_err(const struct extent_buffer *eb, int slot,
        (!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), (alignment)));   \
 })
 
        (!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), (alignment)));   \
 })
 
-static int check_extent_data_item(struct btrfs_fs_info *fs_info,
-                                 struct extent_buffer *leaf,
+static int check_extent_data_item(struct extent_buffer *leaf,
                                  struct btrfs_key *key, int slot)
 {
                                  struct btrfs_key *key, int slot)
 {
+       struct btrfs_fs_info *fs_info = leaf->fs_info;
        struct btrfs_file_extent_item *fi;
        u32 sectorsize = fs_info->sectorsize;
        u32 item_size = btrfs_item_size_nr(leaf, slot);
        struct btrfs_file_extent_item *fi;
        u32 sectorsize = fs_info->sectorsize;
        u32 item_size = btrfs_item_size_nr(leaf, slot);
@@ -780,7 +780,7 @@ static int check_leaf_item(struct btrfs_fs_info *fs_info,
 
        switch (key->type) {
        case BTRFS_EXTENT_DATA_KEY:
 
        switch (key->type) {
        case BTRFS_EXTENT_DATA_KEY:
-               ret = check_extent_data_item(fs_info, leaf, key, slot);
+               ret = check_extent_data_item(leaf, key, slot);
                break;
        case BTRFS_EXTENT_CSUM_KEY:
                ret = check_csum_item(leaf, key, slot);
                break;
        case BTRFS_EXTENT_CSUM_KEY:
                ret = check_csum_item(leaf, key, slot);