提交 2a3ff0ad 编写于 作者: N Nikolay Borisov 提交者: David Sterba

btrfs: Remove redundant tree argument from extent_readpages

This function is called only from btrfs_readpage and is already passed
the mapping. Simplify its signature by moving the code obtaining
reference to the extent tree in the function. No functional changes.
Signed-off-by: NNikolay Borisov <nborisov@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 29c68b2d
...@@ -4126,9 +4126,8 @@ int extent_writepages(struct extent_io_tree *tree, ...@@ -4126,9 +4126,8 @@ int extent_writepages(struct extent_io_tree *tree,
return ret; return ret;
} }
int extent_readpages(struct extent_io_tree *tree, int extent_readpages(struct address_space *mapping, struct list_head *pages,
struct address_space *mapping, unsigned nr_pages)
struct list_head *pages, unsigned nr_pages)
{ {
struct bio *bio = NULL; struct bio *bio = NULL;
unsigned page_idx; unsigned page_idx;
...@@ -4136,6 +4135,7 @@ int extent_readpages(struct extent_io_tree *tree, ...@@ -4136,6 +4135,7 @@ int extent_readpages(struct extent_io_tree *tree,
struct page *pagepool[16]; struct page *pagepool[16];
struct page *page; struct page *page;
struct extent_map *em_cached = NULL; struct extent_map *em_cached = NULL;
struct extent_io_tree *tree = &BTRFS_I(mapping->host)->io_tree;
int nr = 0; int nr = 0;
u64 prev_em_start = (u64)-1; u64 prev_em_start = (u64)-1;
......
...@@ -416,9 +416,8 @@ int extent_writepages(struct extent_io_tree *tree, ...@@ -416,9 +416,8 @@ int extent_writepages(struct extent_io_tree *tree,
struct writeback_control *wbc); struct writeback_control *wbc);
int btree_write_cache_pages(struct address_space *mapping, int btree_write_cache_pages(struct address_space *mapping,
struct writeback_control *wbc); struct writeback_control *wbc);
int extent_readpages(struct extent_io_tree *tree, int extent_readpages(struct address_space *mapping, struct list_head *pages,
struct address_space *mapping, unsigned nr_pages);
struct list_head *pages, unsigned nr_pages);
int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
__u64 start, __u64 len); __u64 start, __u64 len);
void set_page_extent_mapped(struct page *page); void set_page_extent_mapped(struct page *page);
......
...@@ -8907,10 +8907,9 @@ static int ...@@ -8907,10 +8907,9 @@ static int
btrfs_readpages(struct file *file, struct address_space *mapping, btrfs_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages) struct list_head *pages, unsigned nr_pages)
{ {
struct extent_io_tree *tree; return extent_readpages(mapping, pages, nr_pages);
tree = &BTRFS_I(mapping->host)->io_tree;
return extent_readpages(tree, mapping, pages, nr_pages);
} }
static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags) static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
{ {
int ret = try_release_extent_mapping(page, gfp_flags); int ret = try_release_extent_mapping(page, gfp_flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册