diff options
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index c7b45eb2403d..ba5595d19de1 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -95,7 +95,7 @@ struct scrub_bio { | |||
95 | struct scrub_ctx *sctx; | 95 | struct scrub_ctx *sctx; |
96 | struct btrfs_device *dev; | 96 | struct btrfs_device *dev; |
97 | struct bio *bio; | 97 | struct bio *bio; |
98 | int err; | 98 | blk_status_t status; |
99 | u64 logical; | 99 | u64 logical; |
100 | u64 physical; | 100 | u64 physical; |
101 | #if SCRUB_PAGES_PER_WR_BIO >= SCRUB_PAGES_PER_RD_BIO | 101 | #if SCRUB_PAGES_PER_WR_BIO >= SCRUB_PAGES_PER_RD_BIO |
@@ -1668,14 +1668,14 @@ leave_nomem: | |||
1668 | 1668 | ||
1669 | struct scrub_bio_ret { | 1669 | struct scrub_bio_ret { |
1670 | struct completion event; | 1670 | struct completion event; |
1671 | int error; | 1671 | blk_status_t status; |
1672 | }; | 1672 | }; |
1673 | 1673 | ||
1674 | static void scrub_bio_wait_endio(struct bio *bio) | 1674 | static void scrub_bio_wait_endio(struct bio *bio) |
1675 | { | 1675 | { |
1676 | struct scrub_bio_ret *ret = bio->bi_private; | 1676 | struct scrub_bio_ret *ret = bio->bi_private; |
1677 | 1677 | ||
1678 | ret->error = bio->bi_error; | 1678 | ret->status = bio->bi_status; |
1679 | complete(&ret->event); | 1679 | complete(&ret->event); |
1680 | } | 1680 | } |
1681 | 1681 | ||
@@ -1693,7 +1693,7 @@ static int scrub_submit_raid56_bio_wait(struct btrfs_fs_info *fs_info, | |||
1693 | int ret; | 1693 | int ret; |
1694 | 1694 | ||
1695 | init_completion(&done.event); | 1695 | init_completion(&done.event); |
1696 | done.error = 0; | 1696 | done.status = 0; |
1697 | bio->bi_iter.bi_sector = page->logical >> 9; | 1697 | bio->bi_iter.bi_sector = page->logical >> 9; |
1698 | bio->bi_private = &done; | 1698 | bio->bi_private = &done; |
1699 | bio->bi_end_io = scrub_bio_wait_endio; | 1699 | bio->bi_end_io = scrub_bio_wait_endio; |
@@ -1705,7 +1705,7 @@ static int scrub_submit_raid56_bio_wait(struct btrfs_fs_info *fs_info, | |||
1705 | return ret; | 1705 | return ret; |
1706 | 1706 | ||
1707 | wait_for_completion(&done.event); | 1707 | wait_for_completion(&done.event); |
1708 | if (done.error) | 1708 | if (done.status) |
1709 | return -EIO; | 1709 | return -EIO; |
1710 | 1710 | ||
1711 | return 0; | 1711 | return 0; |
@@ -1937,7 +1937,7 @@ again: | |||
1937 | bio->bi_bdev = sbio->dev->bdev; | 1937 | bio->bi_bdev = sbio->dev->bdev; |
1938 | bio->bi_iter.bi_sector = sbio->physical >> 9; | 1938 | bio->bi_iter.bi_sector = sbio->physical >> 9; |
1939 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); | 1939 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); |
1940 | sbio->err = 0; | 1940 | sbio->status = 0; |
1941 | } else if (sbio->physical + sbio->page_count * PAGE_SIZE != | 1941 | } else if (sbio->physical + sbio->page_count * PAGE_SIZE != |
1942 | spage->physical_for_dev_replace || | 1942 | spage->physical_for_dev_replace || |
1943 | sbio->logical + sbio->page_count * PAGE_SIZE != | 1943 | sbio->logical + sbio->page_count * PAGE_SIZE != |
@@ -1992,7 +1992,7 @@ static void scrub_wr_bio_end_io(struct bio *bio) | |||
1992 | struct scrub_bio *sbio = bio->bi_private; | 1992 | struct scrub_bio *sbio = bio->bi_private; |
1993 | struct btrfs_fs_info *fs_info = sbio->dev->fs_info; | 1993 | struct btrfs_fs_info *fs_info = sbio->dev->fs_info; |
1994 | 1994 | ||
1995 | sbio->err = bio->bi_error; | 1995 | sbio->status = bio->bi_status; |
1996 | sbio->bio = bio; | 1996 | sbio->bio = bio; |
1997 | 1997 | ||
1998 | btrfs_init_work(&sbio->work, btrfs_scrubwrc_helper, | 1998 | btrfs_init_work(&sbio->work, btrfs_scrubwrc_helper, |
@@ -2007,7 +2007,7 @@ static void scrub_wr_bio_end_io_worker(struct btrfs_work *work) | |||
2007 | int i; | 2007 | int i; |
2008 | 2008 | ||
2009 | WARN_ON(sbio->page_count > SCRUB_PAGES_PER_WR_BIO); | 2009 | WARN_ON(sbio->page_count > SCRUB_PAGES_PER_WR_BIO); |
2010 | if (sbio->err) { | 2010 | if (sbio->status) { |
2011 | struct btrfs_dev_replace *dev_replace = | 2011 | struct btrfs_dev_replace *dev_replace = |
2012 | &sbio->sctx->fs_info->dev_replace; | 2012 | &sbio->sctx->fs_info->dev_replace; |
2013 | 2013 | ||
@@ -2341,7 +2341,7 @@ again: | |||
2341 | bio->bi_bdev = sbio->dev->bdev; | 2341 | bio->bi_bdev = sbio->dev->bdev; |
2342 | bio->bi_iter.bi_sector = sbio->physical >> 9; | 2342 | bio->bi_iter.bi_sector = sbio->physical >> 9; |
2343 | bio_set_op_attrs(bio, REQ_OP_READ, 0); | 2343 | bio_set_op_attrs(bio, REQ_OP_READ, 0); |
2344 | sbio->err = 0; | 2344 | sbio->status = 0; |
2345 | } else if (sbio->physical + sbio->page_count * PAGE_SIZE != | 2345 | } else if (sbio->physical + sbio->page_count * PAGE_SIZE != |
2346 | spage->physical || | 2346 | spage->physical || |
2347 | sbio->logical + sbio->page_count * PAGE_SIZE != | 2347 | sbio->logical + sbio->page_count * PAGE_SIZE != |
@@ -2377,7 +2377,7 @@ static void scrub_missing_raid56_end_io(struct bio *bio) | |||
2377 | struct scrub_block *sblock = bio->bi_private; | 2377 | struct scrub_block *sblock = bio->bi_private; |
2378 | struct btrfs_fs_info *fs_info = sblock->sctx->fs_info; | 2378 | struct btrfs_fs_info *fs_info = sblock->sctx->fs_info; |
2379 | 2379 | ||
2380 | if (bio->bi_error) | 2380 | if (bio->bi_status) |
2381 | sblock->no_io_error_seen = 0; | 2381 | sblock->no_io_error_seen = 0; |
2382 | 2382 | ||
2383 | bio_put(bio); | 2383 | bio_put(bio); |
@@ -2588,7 +2588,7 @@ static void scrub_bio_end_io(struct bio *bio) | |||
2588 | struct scrub_bio *sbio = bio->bi_private; | 2588 | struct scrub_bio *sbio = bio->bi_private; |
2589 | struct btrfs_fs_info *fs_info = sbio->dev->fs_info; | 2589 | struct btrfs_fs_info *fs_info = sbio->dev->fs_info; |
2590 | 2590 | ||
2591 | sbio->err = bio->bi_error; | 2591 | sbio->status = bio->bi_status; |
2592 | sbio->bio = bio; | 2592 | sbio->bio = bio; |
2593 | 2593 | ||
2594 | btrfs_queue_work(fs_info->scrub_workers, &sbio->work); | 2594 | btrfs_queue_work(fs_info->scrub_workers, &sbio->work); |
@@ -2601,7 +2601,7 @@ static void scrub_bio_end_io_worker(struct btrfs_work *work) | |||
2601 | int i; | 2601 | int i; |
2602 | 2602 | ||
2603 | BUG_ON(sbio->page_count > SCRUB_PAGES_PER_RD_BIO); | 2603 | BUG_ON(sbio->page_count > SCRUB_PAGES_PER_RD_BIO); |
2604 | if (sbio->err) { | 2604 | if (sbio->status) { |
2605 | for (i = 0; i < sbio->page_count; i++) { | 2605 | for (i = 0; i < sbio->page_count; i++) { |
2606 | struct scrub_page *spage = sbio->pagev[i]; | 2606 | struct scrub_page *spage = sbio->pagev[i]; |
2607 | 2607 | ||
@@ -3004,7 +3004,7 @@ static void scrub_parity_bio_endio(struct bio *bio) | |||
3004 | struct scrub_parity *sparity = (struct scrub_parity *)bio->bi_private; | 3004 | struct scrub_parity *sparity = (struct scrub_parity *)bio->bi_private; |
3005 | struct btrfs_fs_info *fs_info = sparity->sctx->fs_info; | 3005 | struct btrfs_fs_info *fs_info = sparity->sctx->fs_info; |
3006 | 3006 | ||
3007 | if (bio->bi_error) | 3007 | if (bio->bi_status) |
3008 | bitmap_or(sparity->ebitmap, sparity->ebitmap, sparity->dbitmap, | 3008 | bitmap_or(sparity->ebitmap, sparity->ebitmap, sparity->dbitmap, |
3009 | sparity->nsectors); | 3009 | sparity->nsectors); |
3010 | 3010 | ||