diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-14 19:07:32 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-10-02 11:14:50 -0400 |
commit | ce86cd59179279a6fe673d2a105d24fb7e70aef3 (patch) | |
tree | d5a57e9f23ef1041497d9ad7bd7e5c6aeb23fdcd /fs/btrfs/disk-io.c | |
parent | 453848a05ff984cb3665bad5c7e0024e8cfe87a5 (diff) |
btrfs: remove parameter blocksize from read_tree_block
We know the tree block size, no need to pass it around.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 332f63518156..03c0973568ef 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1138,12 +1138,12 @@ int btrfs_wait_tree_block_writeback(struct extent_buffer *buf) | |||
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, | 1140 | struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, |
1141 | u32 blocksize, u64 parent_transid) | 1141 | u64 parent_transid) |
1142 | { | 1142 | { |
1143 | struct extent_buffer *buf = NULL; | 1143 | struct extent_buffer *buf = NULL; |
1144 | int ret; | 1144 | int ret; |
1145 | 1145 | ||
1146 | buf = btrfs_find_create_tree_block(root, bytenr, blocksize); | 1146 | buf = btrfs_find_create_tree_block(root, bytenr, root->nodesize); |
1147 | if (!buf) | 1147 | if (!buf) |
1148 | return NULL; | 1148 | return NULL; |
1149 | 1149 | ||
@@ -1484,7 +1484,6 @@ static struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root, | |||
1484 | struct btrfs_fs_info *fs_info = tree_root->fs_info; | 1484 | struct btrfs_fs_info *fs_info = tree_root->fs_info; |
1485 | struct btrfs_path *path; | 1485 | struct btrfs_path *path; |
1486 | u64 generation; | 1486 | u64 generation; |
1487 | u32 blocksize; | ||
1488 | int ret; | 1487 | int ret; |
1489 | 1488 | ||
1490 | path = btrfs_alloc_path(); | 1489 | path = btrfs_alloc_path(); |
@@ -1509,9 +1508,8 @@ static struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root, | |||
1509 | } | 1508 | } |
1510 | 1509 | ||
1511 | generation = btrfs_root_generation(&root->root_item); | 1510 | generation = btrfs_root_generation(&root->root_item); |
1512 | blocksize = root->nodesize; | ||
1513 | root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), | 1511 | root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), |
1514 | blocksize, generation); | 1512 | generation); |
1515 | if (!root->node) { | 1513 | if (!root->node) { |
1516 | ret = -ENOMEM; | 1514 | ret = -ENOMEM; |
1517 | goto find_fail; | 1515 | goto find_fail; |
@@ -2139,7 +2137,6 @@ int open_ctree(struct super_block *sb, | |||
2139 | { | 2137 | { |
2140 | u32 sectorsize; | 2138 | u32 sectorsize; |
2141 | u32 nodesize; | 2139 | u32 nodesize; |
2142 | u32 blocksize; | ||
2143 | u32 stripesize; | 2140 | u32 stripesize; |
2144 | u64 generation; | 2141 | u64 generation; |
2145 | u64 features; | 2142 | u64 features; |
@@ -2643,7 +2640,6 @@ int open_ctree(struct super_block *sb, | |||
2643 | goto fail_sb_buffer; | 2640 | goto fail_sb_buffer; |
2644 | } | 2641 | } |
2645 | 2642 | ||
2646 | blocksize = tree_root->nodesize; | ||
2647 | generation = btrfs_super_chunk_root_generation(disk_super); | 2643 | generation = btrfs_super_chunk_root_generation(disk_super); |
2648 | 2644 | ||
2649 | __setup_root(nodesize, sectorsize, stripesize, chunk_root, | 2645 | __setup_root(nodesize, sectorsize, stripesize, chunk_root, |
@@ -2651,7 +2647,7 @@ int open_ctree(struct super_block *sb, | |||
2651 | 2647 | ||
2652 | chunk_root->node = read_tree_block(chunk_root, | 2648 | chunk_root->node = read_tree_block(chunk_root, |
2653 | btrfs_super_chunk_root(disk_super), | 2649 | btrfs_super_chunk_root(disk_super), |
2654 | blocksize, generation); | 2650 | generation); |
2655 | if (!chunk_root->node || | 2651 | if (!chunk_root->node || |
2656 | !test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) { | 2652 | !test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) { |
2657 | printk(KERN_WARNING "BTRFS: failed to read chunk root on %s\n", | 2653 | printk(KERN_WARNING "BTRFS: failed to read chunk root on %s\n", |
@@ -2684,12 +2680,11 @@ int open_ctree(struct super_block *sb, | |||
2684 | } | 2680 | } |
2685 | 2681 | ||
2686 | retry_root_backup: | 2682 | retry_root_backup: |
2687 | blocksize = tree_root->nodesize; | ||
2688 | generation = btrfs_super_generation(disk_super); | 2683 | generation = btrfs_super_generation(disk_super); |
2689 | 2684 | ||
2690 | tree_root->node = read_tree_block(tree_root, | 2685 | tree_root->node = read_tree_block(tree_root, |
2691 | btrfs_super_root(disk_super), | 2686 | btrfs_super_root(disk_super), |
2692 | blocksize, generation); | 2687 | generation); |
2693 | if (!tree_root->node || | 2688 | if (!tree_root->node || |
2694 | !test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) { | 2689 | !test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) { |
2695 | printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", | 2690 | printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", |
@@ -2858,7 +2853,6 @@ retry_root_backup: | |||
2858 | err = -EIO; | 2853 | err = -EIO; |
2859 | goto fail_qgroup; | 2854 | goto fail_qgroup; |
2860 | } | 2855 | } |
2861 | blocksize = tree_root->nodesize; | ||
2862 | 2856 | ||
2863 | log_tree_root = btrfs_alloc_root(fs_info); | 2857 | log_tree_root = btrfs_alloc_root(fs_info); |
2864 | if (!log_tree_root) { | 2858 | if (!log_tree_root) { |
@@ -2870,7 +2864,6 @@ retry_root_backup: | |||
2870 | log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID); | 2864 | log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID); |
2871 | 2865 | ||
2872 | log_tree_root->node = read_tree_block(tree_root, bytenr, | 2866 | log_tree_root->node = read_tree_block(tree_root, bytenr, |
2873 | blocksize, | ||
2874 | generation + 1); | 2867 | generation + 1); |
2875 | if (!log_tree_root->node || | 2868 | if (!log_tree_root->node || |
2876 | !extent_buffer_uptodate(log_tree_root->node)) { | 2869 | !extent_buffer_uptodate(log_tree_root->node)) { |