From: Omar Sandoval Date: Tue, 3 Dec 2019 01:34:24 +0000 (-0800) Subject: btrfs: simplify compressed/inline check in __extent_writepage_io() X-Git-Tag: v5.15~4290^2~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8b04030c5ec006e161969d77c07fb03a8b67112;p=platform%2Fkernel%2Flinux-starfive.git btrfs: simplify compressed/inline check in __extent_writepage_io() Commit 7087a9d8db88 ("btrfs: Remove extent_io_ops::writepage_end_io_hook") left this logic in a confusing state. Simplify it. Reviewed-by: Johannes Thumshirn Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index bbfb102..394beb4 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -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;