aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-01-07 04:26:57 -0500
committerChris Mason <clm@fb.com>2014-01-28 16:20:22 -0500
commit8e56338d7d0ee38ecae86d35dae43020356acca1 (patch)
tree92a07b9fc07788ebe3af85468144b41cdc446a5f /fs/btrfs
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/btrfs')
-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_)
4776 WARN_ON(send_root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE); 4776 WARN_ON(send_root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE);
4777 4777
4778 /* 4778 /*
4779 * If we just created this root we need to make sure that the orphan
4780 * cleanup has been done and committed since we search the commit root,
4781 * so check its commit root transid with our otransid and if they match
4782 * commit the transaction to make sure everything is updated.
4783 */
4784 down_read(&send_root->fs_info->extent_commit_sem);
4785 if (btrfs_header_generation(send_root->commit_root) ==
4786 btrfs_root_otransid(&send_root->root_item)) {
4787 struct btrfs_trans_handle *trans;
4788
4789 up_read(&send_root->fs_info->extent_commit_sem);
4790
4791 trans = btrfs_attach_transaction_barrier(send_root);
4792 if (IS_ERR(trans)) {
4793 if (PTR_ERR(trans) != -ENOENT) {
4794 ret = PTR_ERR(trans);
4795 goto out;
4796 }
4797 /* ENOENT means theres no transaction */
4798 } else {
4799 ret = btrfs_commit_transaction(trans, send_root);
4800 if (ret)
4801 goto out;
4802 }
4803 } else {
4804 up_read(&send_root->fs_info->extent_commit_sem);
4805 }
4806
4807 /*
4808 * Userspace tools do the checks and warn the user if it's 4779 * Userspace tools do the checks and warn the user if it's
4809 * not RO. 4780 * not RO.
4810 */ 4781 */