diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2013-12-17 06:57:21 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 16:20:03 -0500 |
commit | 41ce9970a8a6a362ae8df145f7a03d789e9ef9d2 (patch) | |
tree | a5e9007136f4b156fde68dbdd006e3d1324eb2c1 /fs/btrfs | |
parent | 536cd96401dcb986f681bac385b5146b45a44e66 (diff) |
Btrfs: remove transaction from btrfs send
Since daivd did the work that force us to use readonly snapshot,
we can safely remove transaction protection from btrfs send.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/send.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 572e8c758712..78a43b2e5c8e 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -4618,7 +4618,6 @@ out: | |||
4618 | static int full_send_tree(struct send_ctx *sctx) | 4618 | static int full_send_tree(struct send_ctx *sctx) |
4619 | { | 4619 | { |
4620 | int ret; | 4620 | int ret; |
4621 | struct btrfs_trans_handle *trans = NULL; | ||
4622 | struct btrfs_root *send_root = sctx->send_root; | 4621 | struct btrfs_root *send_root = sctx->send_root; |
4623 | struct btrfs_key key; | 4622 | struct btrfs_key key; |
4624 | struct btrfs_key found_key; | 4623 | struct btrfs_key found_key; |
@@ -4640,19 +4639,6 @@ static int full_send_tree(struct send_ctx *sctx) | |||
4640 | key.type = BTRFS_INODE_ITEM_KEY; | 4639 | key.type = BTRFS_INODE_ITEM_KEY; |
4641 | key.offset = 0; | 4640 | key.offset = 0; |
4642 | 4641 | ||
4643 | join_trans: | ||
4644 | /* | ||
4645 | * We need to make sure the transaction does not get committed | ||
4646 | * while we do anything on commit roots. Join a transaction to prevent | ||
4647 | * this. | ||
4648 | */ | ||
4649 | trans = btrfs_join_transaction(send_root); | ||
4650 | if (IS_ERR(trans)) { | ||
4651 | ret = PTR_ERR(trans); | ||
4652 | trans = NULL; | ||
4653 | goto out; | ||
4654 | } | ||
4655 | |||
4656 | /* | 4642 | /* |
4657 | * Make sure the tree has not changed after re-joining. We detect this | 4643 | * Make sure the tree has not changed after re-joining. We detect this |
4658 | * by comparing start_ctransid and ctransid. They should always match. | 4644 | * by comparing start_ctransid and ctransid. They should always match. |
@@ -4676,19 +4662,6 @@ join_trans: | |||
4676 | goto out_finish; | 4662 | goto out_finish; |
4677 | 4663 | ||
4678 | while (1) { | 4664 | while (1) { |
4679 | /* | ||
4680 | * When someone want to commit while we iterate, end the | ||
4681 | * joined transaction and rejoin. | ||
4682 | */ | ||
4683 | if (btrfs_should_end_transaction(trans, send_root)) { | ||
4684 | ret = btrfs_end_transaction(trans, send_root); | ||
4685 | trans = NULL; | ||
4686 | if (ret < 0) | ||
4687 | goto out; | ||
4688 | btrfs_release_path(path); | ||
4689 | goto join_trans; | ||
4690 | } | ||
4691 | |||
4692 | eb = path->nodes[0]; | 4665 | eb = path->nodes[0]; |
4693 | slot = path->slots[0]; | 4666 | slot = path->slots[0]; |
4694 | btrfs_item_key_to_cpu(eb, &found_key, slot); | 4667 | btrfs_item_key_to_cpu(eb, &found_key, slot); |
@@ -4716,12 +4689,6 @@ out_finish: | |||
4716 | 4689 | ||
4717 | out: | 4690 | out: |
4718 | btrfs_free_path(path); | 4691 | btrfs_free_path(path); |
4719 | if (trans) { | ||
4720 | if (!ret) | ||
4721 | ret = btrfs_end_transaction(trans, send_root); | ||
4722 | else | ||
4723 | btrfs_end_transaction(trans, send_root); | ||
4724 | } | ||
4725 | return ret; | 4692 | return ret; |
4726 | } | 4693 | } |
4727 | 4694 | ||