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

btrfs: send: get rid of the label and gotos at ensure_commit_roots_uptodate()

Now that there is a helper to commit the current transaction and we are
using it, there's no need for the label and goto statements at
ensure_commit_roots_uptodate(). So replace them with direct return
statements that call btrfs_commit_current_transaction().

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Filipe Manana and committed by
David Sterba
f9763e4d ded980eb

+2 -10
+2 -10
fs/btrfs/send.c
··· 8001 8001 struct btrfs_root *root = sctx->parent_root; 8002 8002 8003 8003 if (root && root->node != root->commit_root) 8004 - goto commit_trans; 8004 + return btrfs_commit_current_transaction(root); 8005 8005 8006 8006 for (int i = 0; i < sctx->clone_roots_cnt; i++) { 8007 8007 root = sctx->clone_roots[i].root; 8008 8008 if (root->node != root->commit_root) 8009 - goto commit_trans; 8009 + return btrfs_commit_current_transaction(root); 8010 8010 } 8011 8011 8012 8012 return 0; 8013 - 8014 - commit_trans: 8015 - /* 8016 - * Use the first root we found. We could use any but that would cause 8017 - * an unnecessary update of the root's item in the root tree when 8018 - * committing the transaction if that root wasn't changed before. 8019 - */ 8020 - return btrfs_commit_current_transaction(root); 8021 8013 } 8022 8014 8023 8015 /*