Skip to content

Commit

Permalink
btrfs: sink arugment tree to contiguous_readpages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Sterba committed Mar 23, 2020
1 parent 0d44fea commit b6660e8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3318,19 +3318,17 @@ static int __do_readpage(struct extent_io_tree *tree,
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,
unsigned long *bio_flags,
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++) {
Expand Down Expand Up @@ -4328,7 +4326,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;

Expand All @@ -4355,7 +4352,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);
}
Expand Down

0 comments on commit b6660e8

Please sign in to comment.