diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-04-19 03:46:36 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 12:07:19 -0400 |
commit | 2a3ff0adc92069122a75c3e37271d7ab7ce0dc1c (patch) | |
tree | 5bbd1599a127a6c43fc585e6a3a09eb578b9abf2 | |
parent | 29c68b2de98c23a2c97fa02c37ce9bf3c15076bd (diff) |
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: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 6 | ||||
-rw-r--r-- | fs/btrfs/extent_io.h | 5 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 5 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d1a4434152da..20bb056b7eca 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -4126,9 +4126,8 @@ int extent_writepages(struct extent_io_tree *tree, | |||
4126 | return ret; | 4126 | return ret; |
4127 | } | 4127 | } |
4128 | 4128 | ||
4129 | int extent_readpages(struct extent_io_tree *tree, | 4129 | int extent_readpages(struct address_space *mapping, struct list_head *pages, |
4130 | struct address_space *mapping, | 4130 | unsigned nr_pages) |
4131 | struct list_head *pages, unsigned nr_pages) | ||
4132 | { | 4131 | { |
4133 | struct bio *bio = NULL; | 4132 | struct bio *bio = NULL; |
4134 | unsigned page_idx; | 4133 | unsigned page_idx; |
@@ -4136,6 +4135,7 @@ int extent_readpages(struct extent_io_tree *tree, | |||
4136 | struct page *pagepool[16]; | 4135 | struct page *pagepool[16]; |
4137 | struct page *page; | 4136 | struct page *page; |
4138 | struct extent_map *em_cached = NULL; | 4137 | struct extent_map *em_cached = NULL; |
4138 | struct extent_io_tree *tree = &BTRFS_I(mapping->host)->io_tree; | ||
4139 | int nr = 0; | 4139 | int nr = 0; |
4140 | u64 prev_em_start = (u64)-1; | 4140 | u64 prev_em_start = (u64)-1; |
4141 | 4141 | ||
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 29d47383b113..752ad87e40d5 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -416,9 +416,8 @@ int extent_writepages(struct extent_io_tree *tree, | |||
416 | struct writeback_control *wbc); | 416 | struct writeback_control *wbc); |
417 | int btree_write_cache_pages(struct address_space *mapping, | 417 | int btree_write_cache_pages(struct address_space *mapping, |
418 | struct writeback_control *wbc); | 418 | struct writeback_control *wbc); |
419 | int extent_readpages(struct extent_io_tree *tree, | 419 | int extent_readpages(struct address_space *mapping, struct list_head *pages, |
420 | struct address_space *mapping, | 420 | unsigned nr_pages); |
421 | struct list_head *pages, unsigned nr_pages); | ||
422 | int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 421 | int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
423 | __u64 start, __u64 len); | 422 | __u64 start, __u64 len); |
424 | void set_page_extent_mapped(struct page *page); | 423 | void set_page_extent_mapped(struct page *page); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6853cd836a41..53ba8e8f1148 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -8907,10 +8907,9 @@ static int | |||
8907 | btrfs_readpages(struct file *file, struct address_space *mapping, | 8907 | btrfs_readpages(struct file *file, struct address_space *mapping, |
8908 | struct list_head *pages, unsigned nr_pages) | 8908 | struct list_head *pages, unsigned nr_pages) |
8909 | { | 8909 | { |
8910 | struct extent_io_tree *tree; | 8910 | return extent_readpages(mapping, pages, nr_pages); |
8911 | tree = &BTRFS_I(mapping->host)->io_tree; | ||
8912 | return extent_readpages(tree, mapping, pages, nr_pages); | ||
8913 | } | 8911 | } |
8912 | |||
8914 | static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags) | 8913 | static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags) |
8915 | { | 8914 | { |
8916 | int ret = try_release_extent_mapping(page, gfp_flags); | 8915 | int ret = try_release_extent_mapping(page, gfp_flags); |