Commit c8b04030 authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba
Browse files

btrfs: simplify compressed/inline check in __extent_writepage_io()



Commit 7087a9d8 ("btrfs: Remove
extent_io_ops::writepage_end_io_hook") left this logic in a confusing
state. Simplify it.

Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 39b07b5d
Loading
Loading
Loading
Loading
+4 −15
Original line number Diff line number Diff line
@@ -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;