btrfs: remove redundant parameter from btree_readahead_hook
authorDavid Sterba <dsterba@suse.com>
Thu, 2 Mar 2017 18:43:30 +0000 (19:43 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Apr 2017 12:07:25 +0000 (14:07 +0200)
We can read fs_info from eb.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/reada.c

index 285566cc2f7dee4abe7744f07b0ed1abaf53ed00..7343bf7f2b358153e332ef0d1767cbeb9f0b8612 100644 (file)
@@ -3672,8 +3672,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root,
                              struct btrfs_key *start, struct btrfs_key *end);
 int btrfs_reada_wait(void *handle);
 void btrfs_reada_detach(void *handle);
-int btree_readahead_hook(struct btrfs_fs_info *fs_info,
-                        struct extent_buffer *eb, int err);
+int btree_readahead_hook(struct extent_buffer *eb, int err);
 
 static inline int is_fstree(u64 rootid)
 {
index 12eba54877c2e84ae378c4773cccac837f64595d..a9314fe494c92a3e0902b90bfc230963769fa286 100644 (file)
@@ -762,7 +762,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 err:
        if (reads_done &&
            test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
-               btree_readahead_hook(fs_info, eb, ret);
+               btree_readahead_hook(eb, ret);
 
        if (ret) {
                /*
@@ -787,7 +787,7 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
        eb->read_mirror = failed_mirror;
        atomic_dec(&eb->io_pages);
        if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
-               btree_readahead_hook(eb->fs_info, eb, -EIO);
+               btree_readahead_hook(eb, -EIO);
        return -EIO;    /* we fixed nothing */
 }
 
index a7fa4a5cb2963e49297e7b7c57f0098e59bd12b2..306e5108aac705d56e10c4a14ef18e842da4584b 100644 (file)
@@ -209,9 +209,9 @@ cleanup:
        return;
 }
 
-int btree_readahead_hook(struct btrfs_fs_info *fs_info,
-                        struct extent_buffer *eb, int err)
+int btree_readahead_hook(struct extent_buffer *eb, int err)
 {
+       struct btrfs_fs_info *fs_info = eb->fs_info;
        int ret = 0;
        struct reada_extent *re;