diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_io.c | 17 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 22 | ||||
-rw-r--r-- | fs/btrfs/volumes.h | 2 |
3 files changed, 2 insertions, 39 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3e7c9ed6505b..49085f2336d2 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2329,23 +2329,10 @@ static void end_bio_extent_readpage(struct bio *bio, int err) | |||
2329 | if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) { | 2329 | if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) { |
2330 | ret = tree->ops->readpage_end_io_hook(page, start, end, | 2330 | ret = tree->ops->readpage_end_io_hook(page, start, end, |
2331 | state, mirror); | 2331 | state, mirror); |
2332 | if (ret) { | 2332 | if (ret) |
2333 | /* no IO indicated but software detected errors | ||
2334 | * in the block, either checksum errors or | ||
2335 | * issues with the contents */ | ||
2336 | struct btrfs_root *root = | ||
2337 | BTRFS_I(page->mapping->host)->root; | ||
2338 | struct btrfs_device *device; | ||
2339 | |||
2340 | uptodate = 0; | 2333 | uptodate = 0; |
2341 | device = btrfs_find_device_for_logical( | 2334 | else |
2342 | root, start, mirror); | ||
2343 | if (device) | ||
2344 | btrfs_dev_stat_inc_and_print(device, | ||
2345 | BTRFS_DEV_STAT_CORRUPTION_ERRS); | ||
2346 | } else { | ||
2347 | clean_io_failure(start, page); | 2335 | clean_io_failure(start, page); |
2348 | } | ||
2349 | } | 2336 | } |
2350 | 2337 | ||
2351 | if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) { | 2338 | if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) { |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 0b1e69d380dd..3f4e70e171ed 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4610,28 +4610,6 @@ int btrfs_read_sys_array(struct btrfs_root *root) | |||
4610 | return ret; | 4610 | return ret; |
4611 | } | 4611 | } |
4612 | 4612 | ||
4613 | struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root, | ||
4614 | u64 logical, int mirror_num) | ||
4615 | { | ||
4616 | struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree; | ||
4617 | int ret; | ||
4618 | u64 map_length = 0; | ||
4619 | struct btrfs_bio *bbio = NULL; | ||
4620 | struct btrfs_device *device; | ||
4621 | |||
4622 | BUG_ON(mirror_num == 0); | ||
4623 | ret = btrfs_map_block(map_tree, WRITE, logical, &map_length, &bbio, | ||
4624 | mirror_num); | ||
4625 | if (ret) { | ||
4626 | BUG_ON(bbio != NULL); | ||
4627 | return NULL; | ||
4628 | } | ||
4629 | BUG_ON(mirror_num != bbio->mirror_num); | ||
4630 | device = bbio->stripes[mirror_num - 1].dev; | ||
4631 | kfree(bbio); | ||
4632 | return device; | ||
4633 | } | ||
4634 | |||
4635 | int btrfs_read_chunk_tree(struct btrfs_root *root) | 4613 | int btrfs_read_chunk_tree(struct btrfs_root *root) |
4636 | { | 4614 | { |
4637 | struct btrfs_path *path; | 4615 | struct btrfs_path *path; |
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 5479325987b3..53c06af92e8d 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -289,8 +289,6 @@ int btrfs_cancel_balance(struct btrfs_fs_info *fs_info); | |||
289 | int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); | 289 | int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); |
290 | int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes, | 290 | int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes, |
291 | u64 *start, u64 *max_avail); | 291 | u64 *start, u64 *max_avail); |
292 | struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root, | ||
293 | u64 logical, int mirror_num); | ||
294 | void btrfs_dev_stat_print_on_error(struct btrfs_device *device); | 292 | void btrfs_dev_stat_print_on_error(struct btrfs_device *device); |
295 | void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index); | 293 | void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index); |
296 | int btrfs_get_dev_stats(struct btrfs_root *root, | 294 | int btrfs_get_dev_stats(struct btrfs_root *root, |