btrfs: sink extent_write_locked_range tree parameter
authorNikolay Borisov <nborisov@suse.com>
Fri, 8 Dec 2017 13:55:58 +0000 (15:55 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:16 +0000 (16:08 +0100)
This function is called only from submit_compressed_extents and the
io tree being passed is always that of the inode. But we are also
passing the inode, so just move getting the io tree pointer in
extent_write_locked_range to simplify the signature.

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 16ae832bdb5d912cebc04c5c2d7d7aabb57994ab..c0b2bf65d6b080cbb2a1c6f064d99da7b131e24a 100644 (file)
@@ -4073,11 +4073,12 @@ int extent_write_full_page(struct extent_io_tree *tree, struct page *page,
        return ret;
 }
 
-int extent_write_locked_range(struct extent_io_tree *tree, struct inode *inode,
-                             u64 start, u64 end, int mode)
+int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
+                             int mode)
 {
        int ret = 0;
        struct address_space *mapping = inode->i_mapping;
+       struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
        struct page *page;
        unsigned long nr_pages = (end - start + PAGE_SIZE) >>
                PAGE_SHIFT;
index c28f5ef88f4276e128baa96ebb7e81ec38ef9389..f2cbabb2306acbae90e711d018d7ee3d5324930a 100644 (file)
@@ -405,8 +405,8 @@ 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_locked_range(struct extent_io_tree *tree, struct inode *inode,
-                             u64 start, u64 end, int mode);
+int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
+                             int mode);
 int extent_writepages(struct extent_io_tree *tree,
                      struct address_space *mapping,
                      struct writeback_control *wbc);
index 9ad8c9321c8f6eb2f2f26692676d187148f09597..8a7da59292b7d55b067d795c4ac55e11c7f05bcc 100644 (file)
@@ -770,8 +770,8 @@ retry:
                         * all those pages down to the drive.
                         */
                        if (!page_started && !ret)
-                               extent_write_locked_range(io_tree,
-                                                 inode, async_extent->start,
+                               extent_write_locked_range(inode,
+                                                 async_extent->start,
                                                  async_extent->start +
                                                  async_extent->ram_size - 1,
                                                  WB_SYNC_ALL);