aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index b4783bf8bf4f..dbd3f636dd3d 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -61,7 +61,7 @@ static int btrfs_cow_block(struct btrfs_trans_handle *trans, struct btrfs_root
61 *cow_ret = buf; 61 *cow_ret = buf;
62 return 0; 62 return 0;
63 } 63 }
64 cow = btrfs_alloc_free_block(trans, root); 64 cow = btrfs_alloc_free_block(trans, root, buf->b_blocknr);
65 cow_node = btrfs_buffer_node(cow); 65 cow_node = btrfs_buffer_node(cow);
66 if (buf->b_size != root->blocksize || cow->b_size != root->blocksize) 66 if (buf->b_size != root->blocksize || cow->b_size != root->blocksize)
67 WARN_ON(1); 67 WARN_ON(1);
@@ -800,7 +800,7 @@ static int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root
800 BUG_ON(path->nodes[level]); 800 BUG_ON(path->nodes[level]);
801 BUG_ON(path->nodes[level-1] != root->node); 801 BUG_ON(path->nodes[level-1] != root->node);
802 802
803 t = btrfs_alloc_free_block(trans, root); 803 t = btrfs_alloc_free_block(trans, root, root->node->b_blocknr);
804 c = btrfs_buffer_node(t); 804 c = btrfs_buffer_node(t);
805 memset(c, 0, root->blocksize); 805 memset(c, 0, root->blocksize);
806 btrfs_set_header_nritems(&c->header, 1); 806 btrfs_set_header_nritems(&c->header, 1);
@@ -905,7 +905,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
905 } 905 }
906 906
907 c_nritems = btrfs_header_nritems(&c->header); 907 c_nritems = btrfs_header_nritems(&c->header);
908 split_buffer = btrfs_alloc_free_block(trans, root); 908 split_buffer = btrfs_alloc_free_block(trans, root, t->b_blocknr);
909 split = btrfs_buffer_node(split_buffer); 909 split = btrfs_buffer_node(split_buffer);
910 btrfs_set_header_flags(&split->header, btrfs_header_flags(&c->header)); 910 btrfs_set_header_flags(&split->header, btrfs_header_flags(&c->header));
911 btrfs_set_header_level(&split->header, btrfs_header_level(&c->header)); 911 btrfs_set_header_level(&split->header, btrfs_header_level(&c->header));
@@ -1277,7 +1277,7 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
1277 slot = path->slots[0]; 1277 slot = path->slots[0];
1278 nritems = btrfs_header_nritems(&l->header); 1278 nritems = btrfs_header_nritems(&l->header);
1279 mid = (nritems + 1)/ 2; 1279 mid = (nritems + 1)/ 2;
1280 right_buffer = btrfs_alloc_free_block(trans, root); 1280 right_buffer = btrfs_alloc_free_block(trans, root, l_buf->b_blocknr);
1281 BUG_ON(!right_buffer); 1281 BUG_ON(!right_buffer);
1282 right = btrfs_buffer_leaf(right_buffer); 1282 right = btrfs_buffer_leaf(right_buffer);
1283 memset(&right->header, 0, sizeof(right->header)); 1283 memset(&right->header, 0, sizeof(right->header));
@@ -1374,7 +1374,7 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
1374 1374
1375 if (!double_split) 1375 if (!double_split)
1376 return ret; 1376 return ret;
1377 right_buffer = btrfs_alloc_free_block(trans, root); 1377 right_buffer = btrfs_alloc_free_block(trans, root, l_buf->b_blocknr);
1378 BUG_ON(!right_buffer); 1378 BUG_ON(!right_buffer);
1379 right = btrfs_buffer_leaf(right_buffer); 1379 right = btrfs_buffer_leaf(right_buffer);
1380 memset(&right->header, 0, sizeof(right->header)); 1380 memset(&right->header, 0, sizeof(right->header));