btrfs: remove unused parameter from readahead_tree_block
authorDavid Sterba <dsterba@suse.cz>
Sat, 14 Jun 2014 22:29:04 +0000 (00:29 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 2 Oct 2014 14:30:18 +0000 (16:30 +0200)
The parent_transid parameter has been unused since its introduction in
ca7a79ad8dbe2466 ("Pass down the expected generation number when reading
tree blocks").  In reada_tree_block, it was even wrongly set to leafsize.
Transid check is done in the proper read and readahead ignores errors.

Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/ctree.c
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c

index 39021bf2df9a9c0cb702f2ca427c640a02a8c3c9..1b7e3545a59637b844fea727c73883a6f3fdabbd 100644 (file)
@@ -2298,7 +2298,7 @@ static void reada_for_search(struct btrfs_root *root,
                if ((search <= target && target - search <= 65536) ||
                    (search > target && search - target <= 65536)) {
                        gen = btrfs_node_ptr_generation(node, nr);
-                       readahead_tree_block(root, search, blocksize, gen);
+                       readahead_tree_block(root, search, blocksize);
                        nread += blocksize;
                }
                nscan++;
@@ -2350,9 +2350,9 @@ static noinline void reada_for_balance(struct btrfs_root *root,
        }
 
        if (block1)
-               readahead_tree_block(root, block1, blocksize, 0);
+               readahead_tree_block(root, block1, blocksize);
        if (block2)
-               readahead_tree_block(root, block2, blocksize, 0);
+               readahead_tree_block(root, block2, blocksize);
 }
 
 
index 4780e6623c7b4c7b674295ccccebc39a20806768..ff83748d39dab66695d314765411321bc34a133f 100644 (file)
@@ -1062,8 +1062,7 @@ static const struct address_space_operations btree_aops = {
        .set_page_dirty = btree_set_page_dirty,
 };
 
-int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
-                        u64 parent_transid)
+int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize)
 {
        struct extent_buffer *buf = NULL;
        struct inode *btree_inode = root->fs_info->btree_inode;
index 14d06ee1e143aa9b0337fbda2b2df398780bdcb2..8cd6a53db621a4c4d4b4a721676478f74b2b8768 100644 (file)
@@ -46,8 +46,7 @@ struct btrfs_fs_devices;
 
 struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
                                      u32 blocksize, u64 parent_transid);
-int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
-                        u64 parent_transid);
+int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize);
 int reada_tree_block_flagged(struct btrfs_root *root, u64 bytenr, u32 blocksize,
                         int mirror_num, struct extent_buffer **eb);
 struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
index 44d04979f071711f99989d00fc2aeb073bdffa4d..058abd088f0fbde7d39ce1e3614a7f7d5bc12b9b 100644 (file)
@@ -7486,8 +7486,7 @@ static noinline void reada_walk_down(struct btrfs_trans_handle *trans,
                                continue;
                }
 reada:
-               ret = readahead_tree_block(root, bytenr, blocksize,
-                                          generation);
+               ret = readahead_tree_block(root, bytenr, blocksize);
                if (ret)
                        break;
                nread++;
index 2d221c46180c659495718cba8a4c0c14c519dc96..16cb2b4a96205ab9f99cd32cf4d038aa20a7aa92 100644 (file)
@@ -2861,13 +2861,8 @@ static int reada_tree_block(struct reloc_control *rc,
                            struct tree_block *block)
 {
        BUG_ON(block->key_ready);
-       if (block->key.type == BTRFS_METADATA_ITEM_KEY)
-               readahead_tree_block(rc->extent_root, block->bytenr,
-                                    block->key.objectid,
-                                    rc->extent_root->nodesize);
-       else
-               readahead_tree_block(rc->extent_root, block->bytenr,
-                                    block->key.objectid, block->key.offset);
+       readahead_tree_block(rc->extent_root, block->bytenr,
+                       block->key.objectid);
        return 0;
 }