[25/30] btrfs: get fs_info from eb in btrfs_check_node
diff mbox series

Message ID 5baccf335bf8706b40b193f9c58e19d2d4c93ec7.1553539114.git.dsterba@suse.com
State New
Headers show
Series
  • Redundant argument cleanups, part 1
Related show

Commit Message

David Sterba March 25, 2019, 6:47 p.m. UTC
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/disk-io.c      | 4 ++--
 fs/btrfs/tree-checker.c | 3 ++-
 fs/btrfs/tree-checker.h | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b6a813705023..78a4f6cf866e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -537,7 +537,7 @@  static int csum_dirty_buffer(struct btrfs_fs_info *fs_info, struct page *page)
 		return -EINVAL;
 
 	if (btrfs_header_level(eb))
-		err = btrfs_check_node(fs_info, eb);
+		err = btrfs_check_node(eb);
 	else
 		err = btrfs_check_leaf_write(fs_info, eb);
 
@@ -670,7 +670,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 0c908a49a525..b4f7d47f8d75 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -662,8 +662,9 @@  int btrfs_check_leaf_write(struct btrfs_fs_info *fs_info,
 	return check_leaf(leaf, false, 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 8923ddcc9956..fd09f2247b7c 100644
--- a/fs/btrfs/tree-checker.h
+++ b/fs/btrfs/tree-checker.h
@@ -23,6 +23,6 @@  int btrfs_check_leaf_full(struct extent_buffer *leaf);
 int btrfs_check_leaf_relaxed(struct extent_buffer *leaf);
 int btrfs_check_leaf_write(struct btrfs_fs_info *fs_info,
 			   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);
 
 #endif