diff mbox series

[8/9] btrfs: simplify compressed/inline check in __extent_writepage_io()

Message ID 8c99ef2ac5f56d6d08716fe8ddfd3a24084f3861.1575336816.git.osandov@fb.com (mailing list archive)
State New, archived
Headers show
Series btrfs: miscellaneous cleanups | expand

Commit Message

Omar Sandoval Dec. 3, 2019, 1:34 a.m. UTC
From: Omar Sandoval <osandov@fb.com>

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

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 fs/btrfs/extent_io.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

Comments

Johannes Thumshirn Dec. 3, 2019, 1:17 p.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff mbox series

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 13c03c42ba5c..385edd31acf0 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3492,22 +3492,13 @@  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;