aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/extent-tree.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c025751c20d7..50ebc74db508 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7215,11 +7215,11 @@ int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
7215 7215
7216static struct extent_buffer * 7216static struct extent_buffer *
7217btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root, 7217btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
7218 u64 bytenr, u32 blocksize, int level) 7218 u64 bytenr, int level)
7219{ 7219{
7220 struct extent_buffer *buf; 7220 struct extent_buffer *buf;
7221 7221
7222 buf = btrfs_find_create_tree_block(root, bytenr, blocksize); 7222 buf = btrfs_find_create_tree_block(root, bytenr, root->nodesize);
7223 if (!buf) 7223 if (!buf)
7224 return ERR_PTR(-ENOMEM); 7224 return ERR_PTR(-ENOMEM);
7225 btrfs_set_header_generation(buf, trans->transid); 7225 btrfs_set_header_generation(buf, trans->transid);
@@ -7338,7 +7338,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
7338 7338
7339 if (btrfs_test_is_dummy_root(root)) { 7339 if (btrfs_test_is_dummy_root(root)) {
7340 buf = btrfs_init_new_buffer(trans, root, root->alloc_bytenr, 7340 buf = btrfs_init_new_buffer(trans, root, root->alloc_bytenr,
7341 blocksize, level); 7341 level);
7342 if (!IS_ERR(buf)) 7342 if (!IS_ERR(buf))
7343 root->alloc_bytenr += blocksize; 7343 root->alloc_bytenr += blocksize;
7344 return buf; 7344 return buf;
@@ -7355,8 +7355,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
7355 return ERR_PTR(ret); 7355 return ERR_PTR(ret);
7356 } 7356 }
7357 7357
7358 buf = btrfs_init_new_buffer(trans, root, ins.objectid, 7358 buf = btrfs_init_new_buffer(trans, root, ins.objectid, level);
7359 blocksize, level);
7360 BUG_ON(IS_ERR(buf)); /* -ENOMEM */ 7359 BUG_ON(IS_ERR(buf)); /* -ENOMEM */
7361 7360
7362 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) { 7361 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) {