diff mbox series

[5/9] btrfs: remove trivial goto label in __extent_writepage()

Message ID 81ea4a6b327f26506041e2e43adc9dfccc7a86fe.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>

Since 40f765805f08 ("Btrfs: split up __extent_writepage to lower stack
usage"), done_unlocked is simply a return 0. Get rid of it.

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

Comments

Johannes Thumshirn Dec. 3, 2019, 1:06 p.m. UTC | #1
On Mon, Dec 02, 2019 at 05:34:21PM -0800, Omar Sandoval wrote:
[...]
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index dad6b06d0a8e..8622282db31e 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3596,7 +3596,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
>  	if (!epd->extent_locked) {
>  		ret = writepage_delalloc(inode, page, wbc, start, &nr_written);
>  		if (ret == 1)
> -			goto done_unlocked;
> +			return 0;
>  		if (ret)
>  			goto done;

Unrelated side note, wouldn't it be more obvious if we do
		if (ret == 1)
			return 0;
		if (ret < 0)
			goto done;
as writepage_delalloc() returns 1, 0, and < 1


Anyways this is not really related to this patch,
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 dad6b06d0a8e..8622282db31e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3596,7 +3596,7 @@  static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 	if (!epd->extent_locked) {
 		ret = writepage_delalloc(inode, page, wbc, start, &nr_written);
 		if (ret == 1)
-			goto done_unlocked;
+			return 0;
 		if (ret)
 			goto done;
 	}
@@ -3604,7 +3604,7 @@  static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 	ret = __extent_writepage_io(inode, page, wbc, epd,
 				    i_size, nr_written, &nr);
 	if (ret == 1)
-		goto done_unlocked;
+		return 0;
 
 done:
 	if (nr == 0) {
@@ -3619,9 +3619,6 @@  static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 	unlock_page(page);
 	ASSERT(ret <= 0);
 	return ret;
-
-done_unlocked:
-	return 0;
 }
 
 void wait_on_extent_buffer_writeback(struct extent_buffer *eb)