Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: remove trivial goto label in __extent_writepage()

Since 40f765805f08 ("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 <jthumshirn@suse.de>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Omar Sandoval and committed by
David Sterba
169d2c87 eb70d222

+2 -5
+2 -5
fs/btrfs/extent_io.c
··· 3596 3596 if (!epd->extent_locked) { 3597 3597 ret = writepage_delalloc(inode, page, wbc, start, &nr_written); 3598 3598 if (ret == 1) 3599 - goto done_unlocked; 3599 + return 0; 3600 3600 if (ret) 3601 3601 goto done; 3602 3602 } ··· 3604 3604 ret = __extent_writepage_io(inode, page, wbc, epd, 3605 3605 i_size, nr_written, &nr); 3606 3606 if (ret == 1) 3607 - goto done_unlocked; 3607 + return 0; 3608 3608 3609 3609 done: 3610 3610 if (nr == 0) { ··· 3619 3619 unlock_page(page); 3620 3620 ASSERT(ret <= 0); 3621 3621 return ret; 3622 - 3623 - done_unlocked: 3624 - return 0; 3625 3622 } 3626 3623 3627 3624 void wait_on_extent_buffer_writeback(struct extent_buffer *eb)