Commit 477a30ba authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Sink extent_tree arguments in try_release_extent_mapping

This function already gets the page from which the two extent trees
are referenced. Simplify its signature by moving the code getting the
trees inside the function. No functional changes.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a79a464d
...@@ -4238,13 +4238,13 @@ static int try_release_extent_state(struct extent_map_tree *map, ...@@ -4238,13 +4238,13 @@ static int try_release_extent_state(struct extent_map_tree *map,
* in the range corresponding to the page, both state records and extent * in the range corresponding to the page, both state records and extent
* map records are removed * map records are removed
*/ */
int try_release_extent_mapping(struct extent_map_tree *map, int try_release_extent_mapping(struct page *page, gfp_t mask)
struct extent_io_tree *tree, struct page *page,
gfp_t mask)
{ {
struct extent_map *em; struct extent_map *em;
u64 start = page_offset(page); u64 start = page_offset(page);
u64 end = start + PAGE_SIZE - 1; u64 end = start + PAGE_SIZE - 1;
struct extent_io_tree *tree = &BTRFS_I(page->mapping->host)->io_tree;
struct extent_map_tree *map = &BTRFS_I(page->mapping->host)->extent_tree;
if (gfpflags_allow_blocking(mask) && if (gfpflags_allow_blocking(mask) &&
page->mapping->host->i_size > SZ_16M) { page->mapping->host->i_size > SZ_16M) {
......
...@@ -270,9 +270,7 @@ typedef struct extent_map *(get_extent_t)(struct btrfs_inode *inode, ...@@ -270,9 +270,7 @@ typedef struct extent_map *(get_extent_t)(struct btrfs_inode *inode,
int create); int create);
void extent_io_tree_init(struct extent_io_tree *tree, void *private_data); void extent_io_tree_init(struct extent_io_tree *tree, void *private_data);
int try_release_extent_mapping(struct extent_map_tree *map, int try_release_extent_mapping(struct page *page, gfp_t mask);
struct extent_io_tree *tree, struct page *page,
gfp_t mask);
int try_release_extent_buffer(struct page *page); int try_release_extent_buffer(struct page *page);
int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
struct extent_state **cached); struct extent_state **cached);
......
...@@ -8913,13 +8913,7 @@ btrfs_readpages(struct file *file, struct address_space *mapping, ...@@ -8913,13 +8913,7 @@ btrfs_readpages(struct file *file, struct address_space *mapping,
} }
static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags) static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
{ {
struct extent_io_tree *tree; int ret = try_release_extent_mapping(page, gfp_flags);
struct extent_map_tree *map;
int ret;
tree = &BTRFS_I(page->mapping->host)->io_tree;
map = &BTRFS_I(page->mapping->host)->extent_tree;
ret = try_release_extent_mapping(map, tree, page, gfp_flags);
if (ret == 1) { if (ret == 1) {
ClearPagePrivate(page); ClearPagePrivate(page);
set_page_private(page, 0); set_page_private(page, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment