diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index cdbb5022da52..6ed6186f51cd 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -874,7 +874,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
874 | unsigned long timeout = 1; | 874 | unsigned long timeout = 1; |
875 | struct btrfs_transaction *cur_trans; | 875 | struct btrfs_transaction *cur_trans; |
876 | struct btrfs_transaction *prev_trans = NULL; | 876 | struct btrfs_transaction *prev_trans = NULL; |
877 | struct extent_io_tree *pinned_copy; | ||
878 | DEFINE_WAIT(wait); | 877 | DEFINE_WAIT(wait); |
879 | int ret; | 878 | int ret; |
880 | int should_grow = 0; | 879 | int should_grow = 0; |
@@ -915,13 +914,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
915 | return 0; | 914 | return 0; |
916 | } | 915 | } |
917 | 916 | ||
918 | pinned_copy = kmalloc(sizeof(*pinned_copy), GFP_NOFS); | ||
919 | if (!pinned_copy) | ||
920 | return -ENOMEM; | ||
921 | |||
922 | extent_io_tree_init(pinned_copy, | ||
923 | root->fs_info->btree_inode->i_mapping, GFP_NOFS); | ||
924 | |||
925 | trans->transaction->in_commit = 1; | 917 | trans->transaction->in_commit = 1; |
926 | trans->transaction->blocked = 1; | 918 | trans->transaction->blocked = 1; |
927 | if (cur_trans->list.prev != &root->fs_info->trans_list) { | 919 | if (cur_trans->list.prev != &root->fs_info->trans_list) { |
@@ -1019,6 +1011,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1019 | ret = commit_cowonly_roots(trans, root); | 1011 | ret = commit_cowonly_roots(trans, root); |
1020 | BUG_ON(ret); | 1012 | BUG_ON(ret); |
1021 | 1013 | ||
1014 | btrfs_prepare_extent_commit(trans, root); | ||
1015 | |||
1022 | cur_trans = root->fs_info->running_transaction; | 1016 | cur_trans = root->fs_info->running_transaction; |
1023 | spin_lock(&root->fs_info->new_trans_lock); | 1017 | spin_lock(&root->fs_info->new_trans_lock); |
1024 | root->fs_info->running_transaction = NULL; | 1018 | root->fs_info->running_transaction = NULL; |
@@ -1042,8 +1036,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1042 | memcpy(&root->fs_info->super_for_commit, &root->fs_info->super_copy, | 1036 | memcpy(&root->fs_info->super_for_commit, &root->fs_info->super_copy, |
1043 | sizeof(root->fs_info->super_copy)); | 1037 | sizeof(root->fs_info->super_copy)); |
1044 | 1038 | ||
1045 | btrfs_copy_pinned(root, pinned_copy); | ||
1046 | |||
1047 | trans->transaction->blocked = 0; | 1039 | trans->transaction->blocked = 0; |
1048 | 1040 | ||
1049 | wake_up(&root->fs_info->transaction_wait); | 1041 | wake_up(&root->fs_info->transaction_wait); |
@@ -1059,8 +1051,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1059 | */ | 1051 | */ |
1060 | mutex_unlock(&root->fs_info->tree_log_mutex); | 1052 | mutex_unlock(&root->fs_info->tree_log_mutex); |
1061 | 1053 | ||
1062 | btrfs_finish_extent_commit(trans, root, pinned_copy); | 1054 | btrfs_finish_extent_commit(trans, root); |
1063 | kfree(pinned_copy); | ||
1064 | 1055 | ||
1065 | /* do the directory inserts of any pending snapshot creations */ | 1056 | /* do the directory inserts of any pending snapshot creations */ |
1066 | finish_pending_snapshots(trans, root->fs_info); | 1057 | finish_pending_snapshots(trans, root->fs_info); |