diff options
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index aeab453b8e24..44ee5d2e52a4 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -280,9 +280,9 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
280 | 280 | ||
281 | WARN_ON(btrfs_header_generation(buf) > trans->transid); | 281 | WARN_ON(btrfs_header_generation(buf) > trans->transid); |
282 | if (new_root_objectid == BTRFS_TREE_RELOC_OBJECTID) | 282 | if (new_root_objectid == BTRFS_TREE_RELOC_OBJECTID) |
283 | ret = btrfs_inc_ref(trans, root, cow, 1, 1); | 283 | ret = btrfs_inc_ref(trans, root, cow, 1); |
284 | else | 284 | else |
285 | ret = btrfs_inc_ref(trans, root, cow, 0, 1); | 285 | ret = btrfs_inc_ref(trans, root, cow, 0); |
286 | 286 | ||
287 | if (ret) | 287 | if (ret) |
288 | return ret; | 288 | return ret; |
@@ -1035,14 +1035,14 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, | |||
1035 | if ((owner == root->root_key.objectid || | 1035 | if ((owner == root->root_key.objectid || |
1036 | root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && | 1036 | root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && |
1037 | !(flags & BTRFS_BLOCK_FLAG_FULL_BACKREF)) { | 1037 | !(flags & BTRFS_BLOCK_FLAG_FULL_BACKREF)) { |
1038 | ret = btrfs_inc_ref(trans, root, buf, 1, 1); | 1038 | ret = btrfs_inc_ref(trans, root, buf, 1); |
1039 | BUG_ON(ret); /* -ENOMEM */ | 1039 | BUG_ON(ret); /* -ENOMEM */ |
1040 | 1040 | ||
1041 | if (root->root_key.objectid == | 1041 | if (root->root_key.objectid == |
1042 | BTRFS_TREE_RELOC_OBJECTID) { | 1042 | BTRFS_TREE_RELOC_OBJECTID) { |
1043 | ret = btrfs_dec_ref(trans, root, buf, 0, 1); | 1043 | ret = btrfs_dec_ref(trans, root, buf, 0); |
1044 | BUG_ON(ret); /* -ENOMEM */ | 1044 | BUG_ON(ret); /* -ENOMEM */ |
1045 | ret = btrfs_inc_ref(trans, root, cow, 1, 1); | 1045 | ret = btrfs_inc_ref(trans, root, cow, 1); |
1046 | BUG_ON(ret); /* -ENOMEM */ | 1046 | BUG_ON(ret); /* -ENOMEM */ |
1047 | } | 1047 | } |
1048 | new_flags |= BTRFS_BLOCK_FLAG_FULL_BACKREF; | 1048 | new_flags |= BTRFS_BLOCK_FLAG_FULL_BACKREF; |
@@ -1050,9 +1050,9 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, | |||
1050 | 1050 | ||
1051 | if (root->root_key.objectid == | 1051 | if (root->root_key.objectid == |
1052 | BTRFS_TREE_RELOC_OBJECTID) | 1052 | BTRFS_TREE_RELOC_OBJECTID) |
1053 | ret = btrfs_inc_ref(trans, root, cow, 1, 1); | 1053 | ret = btrfs_inc_ref(trans, root, cow, 1); |
1054 | else | 1054 | else |
1055 | ret = btrfs_inc_ref(trans, root, cow, 0, 1); | 1055 | ret = btrfs_inc_ref(trans, root, cow, 0); |
1056 | BUG_ON(ret); /* -ENOMEM */ | 1056 | BUG_ON(ret); /* -ENOMEM */ |
1057 | } | 1057 | } |
1058 | if (new_flags != 0) { | 1058 | if (new_flags != 0) { |
@@ -1069,11 +1069,11 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, | |||
1069 | if (flags & BTRFS_BLOCK_FLAG_FULL_BACKREF) { | 1069 | if (flags & BTRFS_BLOCK_FLAG_FULL_BACKREF) { |
1070 | if (root->root_key.objectid == | 1070 | if (root->root_key.objectid == |
1071 | BTRFS_TREE_RELOC_OBJECTID) | 1071 | BTRFS_TREE_RELOC_OBJECTID) |
1072 | ret = btrfs_inc_ref(trans, root, cow, 1, 1); | 1072 | ret = btrfs_inc_ref(trans, root, cow, 1); |
1073 | else | 1073 | else |
1074 | ret = btrfs_inc_ref(trans, root, cow, 0, 1); | 1074 | ret = btrfs_inc_ref(trans, root, cow, 0); |
1075 | BUG_ON(ret); /* -ENOMEM */ | 1075 | BUG_ON(ret); /* -ENOMEM */ |
1076 | ret = btrfs_dec_ref(trans, root, buf, 1, 1); | 1076 | ret = btrfs_dec_ref(trans, root, buf, 1); |
1077 | BUG_ON(ret); /* -ENOMEM */ | 1077 | BUG_ON(ret); /* -ENOMEM */ |
1078 | } | 1078 | } |
1079 | clean_tree_block(trans, root, buf); | 1079 | clean_tree_block(trans, root, buf); |