btrfs: remove unnecessary pg_offset assignments in __extent_writepage()
authorOmar Sandoval <osandov@fb.com>
Tue, 3 Dec 2019 01:34:20 +0000 (17:34 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:54 +0000 (16:40 +0100)
We're initializing pg_offset to 0, setting it immediately, then
reassigning it to 0 again after. The former became unnecessary in
211c17f51f46 ("Fix corners in writepage and btrfs_truncate_page"). The
latter is a leftover that should've been removed in 40f765805f08
("Btrfs: split up __extent_writepage to lower stack usage"). Remove
both.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 2f4802f405a246e71d9ac2602b98ef494a535f0e..b2d0418a4c5583e995e0dc418b723e984b0b709d 100644 (file)
@@ -3562,7 +3562,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
        u64 page_end = start + PAGE_SIZE - 1;
        int ret;
        int nr = 0;
-       size_t pg_offset = 0;
+       size_t pg_offset;
        loff_t i_size = i_size_read(inode);
        unsigned long end_index = i_size >> PAGE_SHIFT;
        unsigned long nr_written = 0;
@@ -3591,8 +3591,6 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
                flush_dcache_page(page);
        }
 
-       pg_offset = 0;
-
        set_page_extent_mapped(page);
 
        if (!epd->extent_locked) {