static void scrub_pending_trans_workers_dec(struct scrub_ctx *sctx);
static int scrub_handle_errored_block(struct scrub_block *sblock_to_check);
static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
- struct btrfs_mapping_tree *map_tree,
+ struct btrfs_fs_info *fs_info,
u64 length, u64 logical,
struct scrub_block *sblock);
static void scrub_recheck_block(struct btrfs_fs_info *fs_info,
}
if (PageUptodate(page)) {
- struct btrfs_mapping_tree *map_tree;
+ struct btrfs_fs_info *fs_info;
if (PageDirty(page)) {
/*
* we need to write the data to the defect sector. the
ret = -EIO;
goto out;
}
- map_tree = &BTRFS_I(inode)->root->fs_info->mapping_tree;
- ret = repair_io_failure(map_tree, offset, PAGE_SIZE,
+ fs_info = BTRFS_I(inode)->root->fs_info;
+ ret = repair_io_failure(fs_info, offset, PAGE_SIZE,
fixup->logical, page,
fixup->mirror_num);
unlock_page(page);
}
/* setup the context, map the logical blocks and alloc the pages */
- ret = scrub_setup_recheck_block(sctx, &fs_info->mapping_tree, length,
+ ret = scrub_setup_recheck_block(sctx, fs_info, length,
logical, sblocks_for_recheck);
if (ret) {
spin_lock(&sctx->stat_lock);
}
static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
- struct btrfs_mapping_tree *map_tree,
+ struct btrfs_fs_info *fs_info,
u64 length, u64 logical,
struct scrub_block *sblocks_for_recheck)
{
* with a length of PAGE_SIZE, each returned stripe
* represents one mirror
*/
- ret = btrfs_map_block(map_tree, WRITE, logical, &mapped_length,
+ ret = btrfs_map_block(fs_info, WRITE, logical, &mapped_length,
&bbio, 0);
if (ret || !bbio || mapped_length < sublen) {
kfree(bbio);