]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: reada, sink start parameter to btree_readahead_hook
authorDavid Sterba <dsterba@suse.com>
Tue, 8 Nov 2016 12:50:03 +0000 (13:50 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Nov 2016 12:45:16 +0000 (13:45 +0100)
Originally, the eb and start were passed separately in case eb is NULL.
Since the readahead has been refactored in 4.6, this is not true anymore
and we can get rid of the parameter.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/reada.c

index b26b8b363f7f25c56c1a5b5ad6947ef62b4679b9..9768ce804265b7f95d3f17c8215b2478a6299d3a 100644 (file)
@@ -3661,7 +3661,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root,
 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, u64 start, int err);
+                        struct extent_buffer *eb, int err);
 
 static inline int is_fstree(u64 rootid)
 {
index 3a57f99d96aa7aa0af541e328af203ff73acdb64..9c4ef833ba0b22c56ff2436599b895c8a746642b 100644 (file)
@@ -747,7 +747,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, eb->start, ret);
+               btree_readahead_hook(fs_info, eb, ret);
 
        if (ret) {
                /*
@@ -772,7 +772,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, eb->start, -EIO);
+               btree_readahead_hook(eb->fs_info, eb, -EIO);
        return -EIO;    /* we fixed nothing */
 }
 
index 9c7a0424af1b9c37d48b44fe38d1d002452a33de..e910bd9b1588612a58ce0dd4eafbfc909ef44436 100644 (file)
@@ -209,12 +209,8 @@ static void __readahead_hook(struct btrfs_fs_info *fs_info,
        return;
 }
 
-/*
- * start is passed separately in case eb in NULL, which may be the case with
- * failed I/O
- */
 int btree_readahead_hook(struct btrfs_fs_info *fs_info,
-                        struct extent_buffer *eb, u64 start, int err)
+                        struct extent_buffer *eb, int err)
 {
        int ret = 0;
        struct reada_extent *re;
@@ -222,7 +218,7 @@ int btree_readahead_hook(struct btrfs_fs_info *fs_info,
        /* find extent */
        spin_lock(&fs_info->reada_lock);
        re = radix_tree_lookup(&fs_info->reada_tree,
-                              start >> PAGE_SHIFT);
+                              eb->start >> PAGE_SHIFT);
        if (re)
                re->refcnt++;
        spin_unlock(&fs_info->reada_lock);