diff options
-rw-r--r-- | fs/btrfs/check-integrity.c | 12 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 11 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 3 | ||||
-rw-r--r-- | fs/btrfs/volumes.h | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 5a3e45db642a..58dfac1359a3 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -723,7 +723,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state, | |||
723 | } | 723 | } |
724 | 724 | ||
725 | num_copies = | 725 | num_copies = |
726 | btrfs_num_copies(&state->root->fs_info->mapping_tree, | 726 | btrfs_num_copies(state->root->fs_info, |
727 | next_bytenr, state->metablock_size); | 727 | next_bytenr, state->metablock_size); |
728 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) | 728 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) |
729 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", | 729 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", |
@@ -903,7 +903,7 @@ static int btrfsic_process_superblock_dev_mirror( | |||
903 | } | 903 | } |
904 | 904 | ||
905 | num_copies = | 905 | num_copies = |
906 | btrfs_num_copies(&state->root->fs_info->mapping_tree, | 906 | btrfs_num_copies(state->root->fs_info, |
907 | next_bytenr, state->metablock_size); | 907 | next_bytenr, state->metablock_size); |
908 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) | 908 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) |
909 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", | 909 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", |
@@ -1287,7 +1287,7 @@ static int btrfsic_create_link_to_next_block( | |||
1287 | *next_blockp = NULL; | 1287 | *next_blockp = NULL; |
1288 | if (0 == *num_copiesp) { | 1288 | if (0 == *num_copiesp) { |
1289 | *num_copiesp = | 1289 | *num_copiesp = |
1290 | btrfs_num_copies(&state->root->fs_info->mapping_tree, | 1290 | btrfs_num_copies(state->root->fs_info, |
1291 | next_bytenr, state->metablock_size); | 1291 | next_bytenr, state->metablock_size); |
1292 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) | 1292 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) |
1293 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", | 1293 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", |
@@ -1489,7 +1489,7 @@ static int btrfsic_handle_extent_data( | |||
1489 | chunk_len = num_bytes; | 1489 | chunk_len = num_bytes; |
1490 | 1490 | ||
1491 | num_copies = | 1491 | num_copies = |
1492 | btrfs_num_copies(&state->root->fs_info->mapping_tree, | 1492 | btrfs_num_copies(state->root->fs_info, |
1493 | next_bytenr, state->datablock_size); | 1493 | next_bytenr, state->datablock_size); |
1494 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) | 1494 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) |
1495 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", | 1495 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", |
@@ -2463,7 +2463,7 @@ static int btrfsic_process_written_superblock( | |||
2463 | } | 2463 | } |
2464 | 2464 | ||
2465 | num_copies = | 2465 | num_copies = |
2466 | btrfs_num_copies(&state->root->fs_info->mapping_tree, | 2466 | btrfs_num_copies(state->root->fs_info, |
2467 | next_bytenr, BTRFS_SUPER_INFO_SIZE); | 2467 | next_bytenr, BTRFS_SUPER_INFO_SIZE); |
2468 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) | 2468 | if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) |
2469 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", | 2469 | printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", |
@@ -2960,7 +2960,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2960 | struct btrfsic_block_data_ctx block_ctx; | 2960 | struct btrfsic_block_data_ctx block_ctx; |
2961 | int match = 0; | 2961 | int match = 0; |
2962 | 2962 | ||
2963 | num_copies = btrfs_num_copies(&state->root->fs_info->mapping_tree, | 2963 | num_copies = btrfs_num_copies(state->root->fs_info, |
2964 | bytenr, state->metablock_size); | 2964 | bytenr, state->metablock_size); |
2965 | 2965 | ||
2966 | for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { | 2966 | for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ff5d259ac275..ba2b931fd8f6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -387,7 +387,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, | |||
387 | if (test_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags)) | 387 | if (test_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags)) |
388 | break; | 388 | break; |
389 | 389 | ||
390 | num_copies = btrfs_num_copies(&root->fs_info->mapping_tree, | 390 | num_copies = btrfs_num_copies(root->fs_info, |
391 | eb->start, eb->len); | 391 | eb->start, eb->len); |
392 | if (num_copies == 1) | 392 | if (num_copies == 1) |
393 | break; | 393 | break; |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3c062c8d1d70..e0b7138909f0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2044,10 +2044,10 @@ static int clean_io_failure(u64 start, struct page *page) | |||
2044 | spin_unlock(&BTRFS_I(inode)->io_tree.lock); | 2044 | spin_unlock(&BTRFS_I(inode)->io_tree.lock); |
2045 | 2045 | ||
2046 | if (state && state->start == failrec->start) { | 2046 | if (state && state->start == failrec->start) { |
2047 | map_tree = &BTRFS_I(inode)->root->fs_info->mapping_tree; | 2047 | num_copies = btrfs_num_copies(BTRFS_I(inode)->root->fs_info, |
2048 | num_copies = btrfs_num_copies(map_tree, failrec->logical, | 2048 | failrec->logical, failrec->len); |
2049 | failrec->len); | ||
2050 | if (num_copies > 1) { | 2049 | if (num_copies > 1) { |
2050 | map_tree = &BTRFS_I(inode)->root->fs_info->mapping_tree; | ||
2051 | ret = repair_io_failure(map_tree, start, failrec->len, | 2051 | ret = repair_io_failure(map_tree, start, failrec->len, |
2052 | failrec->logical, page, | 2052 | failrec->logical, page, |
2053 | failrec->failed_mirror); | 2053 | failrec->failed_mirror); |
@@ -2157,9 +2157,8 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page, | |||
2157 | * clean_io_failure() clean all those errors at once. | 2157 | * clean_io_failure() clean all those errors at once. |
2158 | */ | 2158 | */ |
2159 | } | 2159 | } |
2160 | num_copies = btrfs_num_copies( | 2160 | num_copies = btrfs_num_copies(BTRFS_I(inode)->root->fs_info, |
2161 | &BTRFS_I(inode)->root->fs_info->mapping_tree, | 2161 | failrec->logical, failrec->len); |
2162 | failrec->logical, failrec->len); | ||
2163 | if (num_copies == 1) { | 2162 | if (num_copies == 1) { |
2164 | /* | 2163 | /* |
2165 | * we only have a single copy of the data, so don't bother with | 2164 | * we only have a single copy of the data, so don't bother with |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1483041eb86a..5612767b910e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -3785,8 +3785,9 @@ void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree) | |||
3785 | } | 3785 | } |
3786 | } | 3786 | } |
3787 | 3787 | ||
3788 | int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len) | 3788 | int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len) |
3789 | { | 3789 | { |
3790 | struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree; | ||
3790 | struct extent_map *em; | 3791 | struct extent_map *em; |
3791 | struct map_lookup *map; | 3792 | struct map_lookup *map; |
3792 | struct extent_map_tree *em_tree = &map_tree->map_tree; | 3793 | struct extent_map_tree *em_tree = &map_tree->map_tree; |
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 657bb12b3069..35ea4424963b 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -278,7 +278,7 @@ int btrfs_add_device(struct btrfs_trans_handle *trans, | |||
278 | struct btrfs_device *device); | 278 | struct btrfs_device *device); |
279 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); | 279 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); |
280 | void btrfs_cleanup_fs_uuids(void); | 280 | void btrfs_cleanup_fs_uuids(void); |
281 | int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len); | 281 | int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); |
282 | int btrfs_grow_device(struct btrfs_trans_handle *trans, | 282 | int btrfs_grow_device(struct btrfs_trans_handle *trans, |
283 | struct btrfs_device *device, u64 new_size); | 283 | struct btrfs_device *device, u64 new_size); |
284 | struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, | 284 | struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, |