1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-23 00:20:52 -05:00

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>
This commit is contained in:
Filipe Manana 2024-05-22 09:33:32 +01:00 committed by David Sterba
parent ded980eb3f
commit f9763e4d15

View file

@ -8001,23 +8001,15 @@ static int ensure_commit_roots_uptodate(struct send_ctx *sctx)
struct btrfs_root *root = sctx->parent_root;
if (root && root->node != root->commit_root)
goto commit_trans;
return btrfs_commit_current_transaction(root);
for (int i = 0; i < sctx->clone_roots_cnt; i++) {
root = sctx->clone_roots[i].root;
if (root->node != root->commit_root)
goto commit_trans;
return btrfs_commit_current_transaction(root);
}
return 0;
commit_trans:
/*
* Use the first root we found. We could use any but that would cause
* an unnecessary update of the root's item in the root tree when
* committing the transaction if that root wasn't changed before.
*/
return btrfs_commit_current_transaction(root);
}
/*