Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322370
b: refs/heads/master
c: 5ee0844
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Behrens authored and Chris Mason committed Aug 28, 2012
1 parent c614044 commit d7923b2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 68ce9682a4bb95d6be5529cb57214bf2a1b7d20e
refs/heads/master: 5ee0844d6427e7338e0aba748f62b62d07ea2ed0
17 changes: 2 additions & 15 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2329,23 +2329,10 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) {
ret = tree->ops->readpage_end_io_hook(page, start, end,
state, mirror);
if (ret) {
/* no IO indicated but software detected errors
* in the block, either checksum errors or
* issues with the contents */
struct btrfs_root *root =
BTRFS_I(page->mapping->host)->root;
struct btrfs_device *device;

if (ret)
uptodate = 0;
device = btrfs_find_device_for_logical(
root, start, mirror);
if (device)
btrfs_dev_stat_inc_and_print(device,
BTRFS_DEV_STAT_CORRUPTION_ERRS);
} else {
else
clean_io_failure(start, page);
}
}

if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) {
Expand Down
22 changes: 0 additions & 22 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -4610,28 +4610,6 @@ int btrfs_read_sys_array(struct btrfs_root *root)
return ret;
}

struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
u64 logical, int mirror_num)
{
struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree;
int ret;
u64 map_length = 0;
struct btrfs_bio *bbio = NULL;
struct btrfs_device *device;

BUG_ON(mirror_num == 0);
ret = btrfs_map_block(map_tree, WRITE, logical, &map_length, &bbio,
mirror_num);
if (ret) {
BUG_ON(bbio != NULL);
return NULL;
}
BUG_ON(mirror_num != bbio->mirror_num);
device = bbio->stripes[mirror_num - 1].dev;
kfree(bbio);
return device;
}

int btrfs_read_chunk_tree(struct btrfs_root *root)
{
struct btrfs_path *path;
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/btrfs/volumes.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ int btrfs_cancel_balance(struct btrfs_fs_info *fs_info);
int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
u64 *start, u64 *max_avail);
struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
u64 logical, int mirror_num);
void btrfs_dev_stat_print_on_error(struct btrfs_device *device);
void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index);
int btrfs_get_dev_stats(struct btrfs_root *root,
Expand Down

0 comments on commit d7923b2

Please sign in to comment.