From 813fd1dcab2d030ce4445f3ecc143a492a62e8b8 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 20 Mar 2019 16:25:00 +0100 Subject: btrfs: get fs_info from eb in btrfs_check_node We can read fs_info from extent buffer and can drop it from the parameters. Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 2 +- fs/btrfs/tree-checker.c | 3 ++- fs/btrfs/tree-checker.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 516812801081..36c44ddadd2d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -657,7 +657,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio, ret = -EIO; } - if (found_level > 0 && btrfs_check_node(fs_info, eb)) + if (found_level > 0 && btrfs_check_node(eb)) ret = -EIO; if (!ret) diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index 785318ead9af..3f047758ec24 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -973,8 +973,9 @@ int btrfs_check_leaf_relaxed(struct extent_buffer *leaf) return check_leaf(leaf, false); } -int btrfs_check_node(struct btrfs_fs_info *fs_info, struct extent_buffer *node) +int btrfs_check_node(struct extent_buffer *node) { + struct btrfs_fs_info *fs_info = node->fs_info; unsigned long nr = btrfs_header_nritems(node); struct btrfs_key key, next_key; int slot; diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h index 57c121ab8898..96cf044df737 100644 --- a/fs/btrfs/tree-checker.h +++ b/fs/btrfs/tree-checker.h @@ -21,7 +21,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf); * Will only check item pointers, not reading item data. */ int btrfs_check_leaf_relaxed(struct extent_buffer *leaf); -int btrfs_check_node(struct btrfs_fs_info *fs_info, struct extent_buffer *node); +int btrfs_check_node(struct extent_buffer *node); int btrfs_check_chunk_valid(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf, -- cgit v1.2.3