btrfs: sink extent_write_full_page tree argument
authorNikolay Borisov <nborisov@suse.com>
Fri, 8 Dec 2017 13:55:59 +0000 (15:55 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:16 +0000 (16:08 +0100)
The tree argument passed to extent_write_full_page is referenced from
the page being passed to the same function. Since we already have
enough information to get the reference, remove the function parameter.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c

index c0b2bf65d6b080cbb2a1c6f064d99da7b131e24a..6cd3da16f1149a9243c25c6d562b99f0acdc9d10 100644 (file)
@@ -4056,13 +4056,12 @@ static noinline void flush_write_bio(void *data)
        flush_epd_write_bio(epd);
 }
 
-int extent_write_full_page(struct extent_io_tree *tree, struct page *page,
-                         struct writeback_control *wbc)
+int extent_write_full_page(struct page *page, struct writeback_control *wbc)
 {
        int ret;
        struct extent_page_data epd = {
                .bio = NULL,
-               .tree = tree,
+               .tree = &BTRFS_I(page->mapping->host)->io_tree,
                .extent_locked = 0,
                .sync_io = wbc->sync_mode == WB_SYNC_ALL,
        };
index f2cbabb2306acbae90e711d018d7ee3d5324930a..db2558b0cad490aa373b25ed87265554065bd58e 100644 (file)
@@ -403,8 +403,7 @@ int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
                          struct extent_state **cached_state);
 int extent_invalidatepage(struct extent_io_tree *tree,
                          struct page *page, unsigned long offset);
-int extent_write_full_page(struct extent_io_tree *tree, struct page *page,
-                         struct writeback_control *wbc);
+int extent_write_full_page(struct page *page, struct writeback_control *wbc);
 int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
                              int mode);
 int extent_writepages(struct extent_io_tree *tree,
index 8a7da59292b7d55b067d795c4ac55e11c7f05bcc..46df5e2a64e78e2c9988cb730d053198c056c328 100644 (file)
@@ -8855,7 +8855,6 @@ int btrfs_readpage(struct file *file, struct page *page)
 
 static int btrfs_writepage(struct page *page, struct writeback_control *wbc)
 {
-       struct extent_io_tree *tree;
        struct inode *inode = page->mapping->host;
        int ret;
 
@@ -8874,8 +8873,7 @@ static int btrfs_writepage(struct page *page, struct writeback_control *wbc)
                redirty_page_for_writepage(wbc, page);
                return AOP_WRITEPAGE_ACTIVATE;
        }
-       tree = &BTRFS_I(page->mapping->host)->io_tree;
-       ret = extent_write_full_page(tree, page, wbc);
+       ret = extent_write_full_page(page, wbc);
        btrfs_add_delayed_iput(inode);
        return ret;
 }