aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index a67b1a17a009..894bb2732fcc 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -152,7 +152,7 @@ static void scrub_pending_trans_workers_inc(struct scrub_ctx *sctx);
152static void scrub_pending_trans_workers_dec(struct scrub_ctx *sctx); 152static void scrub_pending_trans_workers_dec(struct scrub_ctx *sctx);
153static int scrub_handle_errored_block(struct scrub_block *sblock_to_check); 153static int scrub_handle_errored_block(struct scrub_block *sblock_to_check);
154static int scrub_setup_recheck_block(struct scrub_ctx *sctx, 154static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
155 struct btrfs_mapping_tree *map_tree, 155 struct btrfs_fs_info *fs_info,
156 u64 length, u64 logical, 156 u64 length, u64 logical,
157 struct scrub_block *sblock); 157 struct scrub_block *sblock);
158static void scrub_recheck_block(struct btrfs_fs_info *fs_info, 158static void scrub_recheck_block(struct btrfs_fs_info *fs_info,
@@ -523,7 +523,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *ctx)
523 } 523 }
524 524
525 if (PageUptodate(page)) { 525 if (PageUptodate(page)) {
526 struct btrfs_mapping_tree *map_tree; 526 struct btrfs_fs_info *fs_info;
527 if (PageDirty(page)) { 527 if (PageDirty(page)) {
528 /* 528 /*
529 * we need to write the data to the defect sector. the 529 * we need to write the data to the defect sector. the
@@ -544,8 +544,8 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *ctx)
544 ret = -EIO; 544 ret = -EIO;
545 goto out; 545 goto out;
546 } 546 }
547 map_tree = &BTRFS_I(inode)->root->fs_info->mapping_tree; 547 fs_info = BTRFS_I(inode)->root->fs_info;
548 ret = repair_io_failure(map_tree, offset, PAGE_SIZE, 548 ret = repair_io_failure(fs_info, offset, PAGE_SIZE,
549 fixup->logical, page, 549 fixup->logical, page,
550 fixup->mirror_num); 550 fixup->mirror_num);
551 unlock_page(page); 551 unlock_page(page);
@@ -754,7 +754,7 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
754 } 754 }
755 755
756 /* setup the context, map the logical blocks and alloc the pages */ 756 /* setup the context, map the logical blocks and alloc the pages */
757 ret = scrub_setup_recheck_block(sctx, &fs_info->mapping_tree, length, 757 ret = scrub_setup_recheck_block(sctx, fs_info, length,
758 logical, sblocks_for_recheck); 758 logical, sblocks_for_recheck);
759 if (ret) { 759 if (ret) {
760 spin_lock(&sctx->stat_lock); 760 spin_lock(&sctx->stat_lock);
@@ -1012,7 +1012,7 @@ out:
1012} 1012}
1013 1013
1014static int scrub_setup_recheck_block(struct scrub_ctx *sctx, 1014static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
1015 struct btrfs_mapping_tree *map_tree, 1015 struct btrfs_fs_info *fs_info,
1016 u64 length, u64 logical, 1016 u64 length, u64 logical,
1017 struct scrub_block *sblocks_for_recheck) 1017 struct scrub_block *sblocks_for_recheck)
1018{ 1018{
@@ -1036,7 +1036,7 @@ static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
1036 * with a length of PAGE_SIZE, each returned stripe 1036 * with a length of PAGE_SIZE, each returned stripe
1037 * represents one mirror 1037 * represents one mirror
1038 */ 1038 */
1039 ret = btrfs_map_block(map_tree, WRITE, logical, &mapped_length, 1039 ret = btrfs_map_block(fs_info, WRITE, logical, &mapped_length,
1040 &bbio, 0); 1040 &bbio, 0);
1041 if (ret || !bbio || mapped_length < sublen) { 1041 if (ret || !bbio || mapped_length < sublen) {
1042 kfree(bbio); 1042 kfree(bbio);