Skip to content

Commit

Permalink
btrfs: remove trivial goto label in __extent_writepage()
Browse files Browse the repository at this point in the history
Since 40f7658 ("Btrfs: split up __extent_writepage to lower stack
usage"), done_unlocked is simply a return 0. Get rid of it.
Mid-statement block returns don seem to make the code less readable here.

Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
osandov authored and kdave committed Jan 20, 2020
1 parent eb70d22 commit 169d2c8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3596,15 +3596,15 @@ 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;
}

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) {
Expand All @@ -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)
Expand Down

0 comments on commit 169d2c8

Please sign in to comment.