aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWang Shilong2014-01-07 17:26:57 +0800
committerChris Mason2014-01-28 13:20:22 -0800
commit8e56338d7d0ee38ecae86d35dae43020356acca1 (patch)
tree92a07b9fc07788ebe3af85468144b41cdc446a5f /fs
parent18f687d538449373c37cbe52b03f5f3d42b7c7ed (diff)
Btrfs: remove unnecessary transaction commit before send
We will finish orphan cleanups during snapshot, so we don't have to commit transaction here. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/send.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 4e2461b857f3..591063dac0e6 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -4776,35 +4776,6 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
WARN_ON(send_root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE);
/*
- * If we just created this root we need to make sure that the orphan
- * cleanup has been done and committed since we search the commit root,
- * so check its commit root transid with our otransid and if they match
- * commit the transaction to make sure everything is updated.
- */
- down_read(&send_root->fs_info->extent_commit_sem);
- if (btrfs_header_generation(send_root->commit_root) ==
- btrfs_root_otransid(&send_root->root_item)) {
- struct btrfs_trans_handle *trans;
-
- up_read(&send_root->fs_info->extent_commit_sem);
-
- trans = btrfs_attach_transaction_barrier(send_root);
- if (IS_ERR(trans)) {
- if (PTR_ERR(trans) != -ENOENT) {
- ret = PTR_ERR(trans);
- goto out;
- }
- /* ENOENT means theres no transaction */
- } else {
- ret = btrfs_commit_transaction(trans, send_root);
- if (ret)
- goto out;
- }
- } else {
- up_read(&send_root->fs_info->extent_commit_sem);
- }
-
- /*
* Userspace tools do the checks and warn the user if it's
* not RO.
*/