btrfs: get fs_info from eb in btrfs_verify_level_key
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 13:58:13 +0000 (14:58 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:31 +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/ctree.c
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h

index 3e26254fefe8a9c94629584dbb16641a94234f98..0998e7fba98b4c6b7616f5eca69fc229954197aa 100644 (file)
@@ -2420,7 +2420,7 @@ read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
                         * being cached, read from scrub, or have multiple
                         * parents (shared tree blocks).
                         */
                         * being cached, read from scrub, or have multiple
                         * parents (shared tree blocks).
                         */
-                       if (btrfs_verify_level_key(fs_info, tmp,
+                       if (btrfs_verify_level_key(tmp,
                                        parent_level - 1, &first_key, gen)) {
                                free_extent_buffer(tmp);
                                return -EUCLEAN;
                                        parent_level - 1, &first_key, gen)) {
                                free_extent_buffer(tmp);
                                return -EUCLEAN;
index f7bfa73c254571e1c16554366fded69d1aab00fe..b4c070936289a41f29ccedc26d50530664c2eae2 100644 (file)
@@ -394,10 +394,10 @@ static int btrfs_check_super_csum(struct btrfs_fs_info *fs_info,
        return ret;
 }
 
        return ret;
 }
 
-int btrfs_verify_level_key(struct btrfs_fs_info *fs_info,
-                          struct extent_buffer *eb, int level,
+int btrfs_verify_level_key(struct extent_buffer *eb, int level,
                           struct btrfs_key *first_key, u64 parent_transid)
 {
                           struct btrfs_key *first_key, u64 parent_transid)
 {
+       struct btrfs_fs_info *fs_info = eb->fs_info;
        int found_level;
        struct btrfs_key found_key;
        int ret;
        int found_level;
        struct btrfs_key found_key;
        int ret;
@@ -471,7 +471,7 @@ static int btree_read_extent_buffer_pages(struct extent_buffer *eb,
                        if (verify_parent_transid(io_tree, eb,
                                                   parent_transid, 0))
                                ret = -EIO;
                        if (verify_parent_transid(io_tree, eb,
                                                   parent_transid, 0))
                                ret = -EIO;
-                       else if (btrfs_verify_level_key(fs_info, eb, level,
+                       else if (btrfs_verify_level_key(eb, level,
                                                first_key, parent_transid))
                                ret = -EUCLEAN;
                        else
                                                first_key, parent_transid))
                                ret = -EUCLEAN;
                        else
index 917634f2bae9b451e71634766c907fae72e4bc65..a32158f0c2fc8ecef27ae15186082d24be0221c6 100644 (file)
@@ -39,8 +39,7 @@ static inline u64 btrfs_sb_offset(int mirror)
 struct btrfs_device;
 struct btrfs_fs_devices;
 
 struct btrfs_device;
 struct btrfs_fs_devices;
 
-int btrfs_verify_level_key(struct btrfs_fs_info *fs_info,
-                          struct extent_buffer *eb, int level,
+int btrfs_verify_level_key(struct extent_buffer *eb, int level,
                           struct btrfs_key *first_key, u64 parent_transid);
 struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
                                      u64 parent_transid, int level,
                           struct btrfs_key *first_key, u64 parent_transid);
 struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
                                      u64 parent_transid, int level,