diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index eef4ab56b9ca..60a30da6af00 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -355,7 +355,7 @@ int wait_on_tree_block_writeback(struct btrfs_root *root, | |||
355 | } | 355 | } |
356 | 356 | ||
357 | static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, | 357 | static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, |
358 | struct btrfs_root *root, | 358 | u32 stripesize, struct btrfs_root *root, |
359 | struct btrfs_fs_info *fs_info, | 359 | struct btrfs_fs_info *fs_info, |
360 | u64 objectid) | 360 | u64 objectid) |
361 | { | 361 | { |
@@ -365,6 +365,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, | |||
365 | root->sectorsize = sectorsize; | 365 | root->sectorsize = sectorsize; |
366 | root->nodesize = nodesize; | 366 | root->nodesize = nodesize; |
367 | root->leafsize = leafsize; | 367 | root->leafsize = leafsize; |
368 | root->stripesize = stripesize; | ||
368 | root->ref_cows = 0; | 369 | root->ref_cows = 0; |
369 | root->fs_info = fs_info; | 370 | root->fs_info = fs_info; |
370 | root->objectid = objectid; | 371 | root->objectid = objectid; |
@@ -393,7 +394,8 @@ static int find_and_setup_root(struct btrfs_root *tree_root, | |||
393 | u32 blocksize; | 394 | u32 blocksize; |
394 | 395 | ||
395 | __setup_root(tree_root->nodesize, tree_root->leafsize, | 396 | __setup_root(tree_root->nodesize, tree_root->leafsize, |
396 | tree_root->sectorsize, root, fs_info, objectid); | 397 | tree_root->sectorsize, tree_root->stripesize, |
398 | root, fs_info, objectid); | ||
397 | ret = btrfs_find_last_root(tree_root, objectid, | 399 | ret = btrfs_find_last_root(tree_root, objectid, |
398 | &root->root_item, &root->root_key); | 400 | &root->root_item, &root->root_key); |
399 | BUG_ON(ret); | 401 | BUG_ON(ret); |
@@ -430,8 +432,8 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_fs_info *fs_info, | |||
430 | } | 432 | } |
431 | 433 | ||
432 | __setup_root(tree_root->nodesize, tree_root->leafsize, | 434 | __setup_root(tree_root->nodesize, tree_root->leafsize, |
433 | tree_root->sectorsize, root, fs_info, | 435 | tree_root->sectorsize, tree_root->stripesize, |
434 | location->objectid); | 436 | root, fs_info, location->objectid); |
435 | 437 | ||
436 | path = btrfs_alloc_path(); | 438 | path = btrfs_alloc_path(); |
437 | BUG_ON(!path); | 439 | BUG_ON(!path); |
@@ -537,6 +539,7 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
537 | u32 nodesize; | 539 | u32 nodesize; |
538 | u32 leafsize; | 540 | u32 leafsize; |
539 | u32 blocksize; | 541 | u32 blocksize; |
542 | u32 stripesize; | ||
540 | struct btrfs_root *extent_root = kmalloc(sizeof(struct btrfs_root), | 543 | struct btrfs_root *extent_root = kmalloc(sizeof(struct btrfs_root), |
541 | GFP_NOFS); | 544 | GFP_NOFS); |
542 | struct btrfs_root *tree_root = kmalloc(sizeof(struct btrfs_root), | 545 | struct btrfs_root *tree_root = kmalloc(sizeof(struct btrfs_root), |
@@ -607,7 +610,7 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
607 | goto fail_iput; | 610 | goto fail_iput; |
608 | } | 611 | } |
609 | #endif | 612 | #endif |
610 | __setup_root(512, 512, 512, tree_root, | 613 | __setup_root(512, 512, 512, 512, tree_root, |
611 | fs_info, BTRFS_ROOT_TREE_OBJECTID); | 614 | fs_info, BTRFS_ROOT_TREE_OBJECTID); |
612 | 615 | ||
613 | fs_info->sb_buffer = read_tree_block(tree_root, | 616 | fs_info->sb_buffer = read_tree_block(tree_root, |
@@ -630,9 +633,11 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
630 | nodesize = btrfs_super_nodesize(disk_super); | 633 | nodesize = btrfs_super_nodesize(disk_super); |
631 | leafsize = btrfs_super_leafsize(disk_super); | 634 | leafsize = btrfs_super_leafsize(disk_super); |
632 | sectorsize = btrfs_super_sectorsize(disk_super); | 635 | sectorsize = btrfs_super_sectorsize(disk_super); |
636 | stripesize = btrfs_super_stripesize(disk_super); | ||
633 | tree_root->nodesize = nodesize; | 637 | tree_root->nodesize = nodesize; |
634 | tree_root->leafsize = leafsize; | 638 | tree_root->leafsize = leafsize; |
635 | tree_root->sectorsize = sectorsize; | 639 | tree_root->sectorsize = sectorsize; |
640 | tree_root->stripesize = stripesize; | ||
636 | sb_set_blocksize(sb, sectorsize); | 641 | sb_set_blocksize(sb, sectorsize); |
637 | 642 | ||
638 | i_size_write(fs_info->btree_inode, | 643 | i_size_write(fs_info->btree_inode, |