Merge branch 'for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
[sfrench/cifs-2.6.git] / fs / btrfs / scrub.c
index 7c9c82bb62550877f4dc0d472c95ff9f98c89bd5..e3f6c49e5c4d8aad323b77f72ed6e12da26bee72 100644 (file)
@@ -1738,7 +1738,7 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info,
 
                WARN_ON(!page->page);
                bio = btrfs_io_bio_alloc(1);
-               bio->bi_bdev = page->dev->bdev;
+               bio_set_dev(bio, page->dev->bdev);
 
                bio_add_page(bio, page->page, PAGE_SIZE, 0);
                if (!retry_failed_mirror && scrub_is_page_on_raid56(page)) {
@@ -1826,7 +1826,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad,
                }
 
                bio = btrfs_io_bio_alloc(1);
-               bio->bi_bdev = page_bad->dev->bdev;
+               bio_set_dev(bio, page_bad->dev->bdev);
                bio->bi_iter.bi_sector = page_bad->physical >> 9;
                bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
 
@@ -1921,7 +1921,7 @@ again:
 
                bio->bi_private = sbio;
                bio->bi_end_io = scrub_wr_bio_end_io;
-               bio->bi_bdev = sbio->dev->bdev;
+               bio_set_dev(bio, sbio->dev->bdev);
                bio->bi_iter.bi_sector = sbio->physical >> 9;
                bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
                sbio->status = 0;
@@ -1964,7 +1964,7 @@ static void scrub_wr_submit(struct scrub_ctx *sctx)
 
        sbio = sctx->wr_curr_bio;
        sctx->wr_curr_bio = NULL;
-       WARN_ON(!sbio->bio->bi_bdev);
+       WARN_ON(!sbio->bio->bi_disk);
        scrub_pending_bio_inc(sctx);
        /* process all writes in a single worker thread. Then the block layer
         * orders the requests before sending them to the driver which
@@ -2321,7 +2321,7 @@ again:
 
                bio->bi_private = sbio;
                bio->bi_end_io = scrub_bio_end_io;
-               bio->bi_bdev = sbio->dev->bdev;
+               bio_set_dev(bio, sbio->dev->bdev);
                bio->bi_iter.bi_sector = sbio->physical >> 9;
                bio_set_op_attrs(bio, REQ_OP_READ, 0);
                sbio->status = 0;
@@ -4624,7 +4624,7 @@ static int write_page_nocow(struct scrub_ctx *sctx,
        bio = btrfs_io_bio_alloc(1);
        bio->bi_iter.bi_size = 0;
        bio->bi_iter.bi_sector = physical_for_dev_replace >> 9;
-       bio->bi_bdev = dev->bdev;
+       bio_set_dev(bio, dev->bdev);
        bio->bi_opf = REQ_OP_WRITE | REQ_SYNC;
        ret = bio_add_page(bio, page, PAGE_SIZE, 0);
        if (ret != PAGE_SIZE) {