@@ -1138,12 +1138,12 @@ int btrfs_wait_tree_block_writeback(struct extent_buffer *buf)
11381138}
11391139
11401140struct extent_buffer * read_tree_block (struct btrfs_root * root , u64 bytenr ,
1141- u32 blocksize , u64 parent_transid )
1141+ u64 parent_transid )
11421142{
11431143 struct extent_buffer * buf = NULL ;
11441144 int ret ;
11451145
1146- buf = btrfs_find_create_tree_block (root , bytenr , blocksize );
1146+ buf = btrfs_find_create_tree_block (root , bytenr , root -> nodesize );
11471147 if (!buf )
11481148 return NULL ;
11491149
@@ -1484,7 +1484,6 @@ static struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root,
14841484 struct btrfs_fs_info * fs_info = tree_root -> fs_info ;
14851485 struct btrfs_path * path ;
14861486 u64 generation ;
1487- u32 blocksize ;
14881487 int ret ;
14891488
14901489 path = btrfs_alloc_path ();
@@ -1509,9 +1508,8 @@ static struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root,
15091508 }
15101509
15111510 generation = btrfs_root_generation (& root -> root_item );
1512- blocksize = root -> nodesize ;
15131511 root -> node = read_tree_block (root , btrfs_root_bytenr (& root -> root_item ),
1514- blocksize , generation );
1512+ generation );
15151513 if (!root -> node ) {
15161514 ret = - ENOMEM ;
15171515 goto find_fail ;
@@ -2139,7 +2137,6 @@ int open_ctree(struct super_block *sb,
21392137{
21402138 u32 sectorsize ;
21412139 u32 nodesize ;
2142- u32 blocksize ;
21432140 u32 stripesize ;
21442141 u64 generation ;
21452142 u64 features ;
@@ -2643,15 +2640,14 @@ int open_ctree(struct super_block *sb,
26432640 goto fail_sb_buffer ;
26442641 }
26452642
2646- blocksize = tree_root -> nodesize ;
26472643 generation = btrfs_super_chunk_root_generation (disk_super );
26482644
26492645 __setup_root (nodesize , sectorsize , stripesize , chunk_root ,
26502646 fs_info , BTRFS_CHUNK_TREE_OBJECTID );
26512647
26522648 chunk_root -> node = read_tree_block (chunk_root ,
26532649 btrfs_super_chunk_root (disk_super ),
2654- blocksize , generation );
2650+ generation );
26552651 if (!chunk_root -> node ||
26562652 !test_bit (EXTENT_BUFFER_UPTODATE , & chunk_root -> node -> bflags )) {
26572653 printk (KERN_WARNING "BTRFS: failed to read chunk root on %s\n" ,
@@ -2684,12 +2680,11 @@ int open_ctree(struct super_block *sb,
26842680 }
26852681
26862682retry_root_backup :
2687- blocksize = tree_root -> nodesize ;
26882683 generation = btrfs_super_generation (disk_super );
26892684
26902685 tree_root -> node = read_tree_block (tree_root ,
26912686 btrfs_super_root (disk_super ),
2692- blocksize , generation );
2687+ generation );
26932688 if (!tree_root -> node ||
26942689 !test_bit (EXTENT_BUFFER_UPTODATE , & tree_root -> node -> bflags )) {
26952690 printk (KERN_WARNING "BTRFS: failed to read tree root on %s\n" ,
@@ -2858,7 +2853,6 @@ int open_ctree(struct super_block *sb,
28582853 err = - EIO ;
28592854 goto fail_qgroup ;
28602855 }
2861- blocksize = tree_root -> nodesize ;
28622856
28632857 log_tree_root = btrfs_alloc_root (fs_info );
28642858 if (!log_tree_root ) {
@@ -2870,7 +2864,6 @@ int open_ctree(struct super_block *sb,
28702864 log_tree_root , fs_info , BTRFS_TREE_LOG_OBJECTID );
28712865
28722866 log_tree_root -> node = read_tree_block (tree_root , bytenr ,
2873- blocksize ,
28742867 generation + 1 );
28752868 if (!log_tree_root -> node ||
28762869 !extent_buffer_uptodate (log_tree_root -> node )) {
0 commit comments