diff options
author | David Sterba <dsterba@suse.com> | 2020-02-05 19:09:40 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-02-11 18:42:15 +0100 |
commit | 3e906fb0ee40b5ae066db7b1b2ee212734a1d01a (patch) | |
tree | 3535510011148049de13ffb0c1e01d6d54087f60 | |
parent | 68913c89425764e70d51ff90af29c3990fbce662 (diff) | |
download | btrfs-next-3e906fb0ee40b5ae066db7b1b2ee212734a1d01a.tar.gz |
btrfs: sink arugment tree to contiguous_readpages
The tree pointer can be safely read from the inode, use it and drop the
redundant argument.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 69db46ba388a5b..e7668e85bc1275 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3281,8 +3281,7 @@ out: return ret; } -static inline void contiguous_readpages(struct extent_io_tree *tree, - struct page *pages[], int nr_pages, +static inline void contiguous_readpages(struct page *pages[], int nr_pages, u64 start, u64 end, struct extent_map **em_cached, struct bio **bio, @@ -3290,10 +3289,9 @@ static inline void contiguous_readpages(struct extent_io_tree *tree, u64 *prev_em_start) { struct btrfs_inode *inode = BTRFS_I(pages[0]->mapping->host); + struct extent_io_tree *tree = &inode->io_tree; int index; - ASSERT(tree == &inode->io_tree); - btrfs_lock_and_flush_ordered_range(inode, start, end, NULL); for (index = 0; index < nr_pages; index++) { @@ -4291,7 +4289,6 @@ int extent_readpages(struct address_space *mapping, struct list_head *pages, unsigned long bio_flags = 0; struct page *pagepool[16]; struct extent_map *em_cached = NULL; - struct extent_io_tree *tree = &BTRFS_I(mapping->host)->io_tree; int nr = 0; u64 prev_em_start = (u64)-1; @@ -4318,7 +4315,7 @@ int extent_readpages(struct address_space *mapping, struct list_head *pages, ASSERT(contig_start + nr * PAGE_SIZE - 1 == contig_end); - contiguous_readpages(tree, pagepool, nr, contig_start, + contiguous_readpages(pagepool, nr, contig_start, contig_end, &em_cached, &bio, &bio_flags, &prev_em_start); } |