btrfs: tree-checker: get fs_info from eb in check_inode_item
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 15:22:58 +0000 (16:22 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:35 +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 752ac3bc2587a1056d9023e68e73b2966dc79ad6..6828de4e976c8181d97e2f6bd6ea5403e5c9eef8 100644 (file)
@@ -680,10 +680,10 @@ static int check_dev_item(struct extent_buffer *leaf,
 #define inode_item_err(fs_info, eb, slot, fmt, ...)                    \
        dir_item_err(eb, slot, fmt, __VA_ARGS__)
 
 #define inode_item_err(fs_info, eb, slot, fmt, ...)                    \
        dir_item_err(eb, slot, fmt, __VA_ARGS__)
 
-static int check_inode_item(struct btrfs_fs_info *fs_info,
-                           struct extent_buffer *leaf,
+static int check_inode_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_inode_item *iitem;
        u64 super_gen = btrfs_super_generation(fs_info->super_copy);
        u32 valid_mask = (S_IFMT | S_ISUID | S_ISGID | S_ISVTX | 0777);
        struct btrfs_inode_item *iitem;
        u64 super_gen = btrfs_super_generation(fs_info->super_copy);
        u32 valid_mask = (S_IFMT | S_ISUID | S_ISGID | S_ISVTX | 0777);
@@ -800,7 +800,7 @@ static int check_leaf_item(struct extent_buffer *leaf,
                ret = check_dev_item(leaf, key, slot);
                break;
        case BTRFS_INODE_ITEM_KEY:
                ret = check_dev_item(leaf, key, slot);
                break;
        case BTRFS_INODE_ITEM_KEY:
-               ret = check_inode_item(leaf->fs_info, leaf, key, slot);
+               ret = check_inode_item(leaf, key, slot);
                break;
        }
        return ret;
                break;
        }
        return ret;