]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: simplify compressed/inline check in __extent_writepage_io()
authorOmar Sandoval <osandov@fb.com>
Tue, 3 Dec 2019 01:34:24 +0000 (17:34 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:55 +0000 (16:40 +0100)
Commit 7087a9d8db88 ("btrfs: Remove
extent_io_ops::writepage_end_io_hook") left this logic in a confusing
state. Simplify it.

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 bbfb102d65b86f7f80fdfc59aa5bbf7e370ed128..394beb474a693e72a01c012b90ad965c52ce893b 100644 (file)
@@ -3492,22 +3492,11 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
                 */
                if (compressed || block_start == EXTENT_MAP_HOLE ||
                    block_start == EXTENT_MAP_INLINE) {
-                       /*
-                        * end_io notification does not happen here for
-                        * compressed extents
-                        */
-                       if (!compressed)
-                               btrfs_writepage_endio_finish_ordered(page, cur,
-                                                           cur + iosize - 1,
-                                                           1);
-                       else if (compressed) {
-                               /* we don't want to end_page_writeback on
-                                * a compressed extent.  this happens
-                                * elsewhere
-                                */
+                       if (compressed)
                                nr++;
-                       }
-
+                       else
+                               btrfs_writepage_endio_finish_ordered(page, cur,
+                                                       cur + iosize - 1, 1);
                        cur += iosize;
                        pg_offset += iosize;
                        continue;