Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
[muen/linux.git] / drivers / md / raid5.c
index 34c01e83395af4b618cd56189a1fe4f14d44ae8a..076409455b603582f589ea8fcc68173d421ca33a 100644 (file)
@@ -1101,7 +1101,7 @@ again:
 
                        set_bit(STRIPE_IO_STARTED, &sh->state);
 
-                       bi->bi_bdev = rdev->bdev;
+                       bio_set_dev(bi, rdev->bdev);
                        bio_set_op_attrs(bi, op, op_flags);
                        bi->bi_end_io = op_is_write(op)
                                ? raid5_end_write_request
@@ -1150,7 +1150,7 @@ again:
                                set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags);
 
                        if (conf->mddev->gendisk)
-                               trace_block_bio_remap(bdev_get_queue(bi->bi_bdev),
+                               trace_block_bio_remap(bi->bi_disk->queue,
                                                      bi, disk_devt(conf->mddev->gendisk),
                                                      sh->dev[i].sector);
                        if (should_defer && op_is_write(op))
@@ -1165,7 +1165,7 @@ again:
 
                        set_bit(STRIPE_IO_STARTED, &sh->state);
 
-                       rbi->bi_bdev = rrdev->bdev;
+                       bio_set_dev(rbi, rrdev->bdev);
                        bio_set_op_attrs(rbi, op, op_flags);
                        BUG_ON(!op_is_write(op));
                        rbi->bi_end_io = raid5_end_write_request;
@@ -1198,7 +1198,7 @@ again:
                        if (op == REQ_OP_DISCARD)
                                rbi->bi_vcnt = 0;
                        if (conf->mddev->gendisk)
-                               trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev),
+                               trace_block_bio_remap(rbi->bi_disk->queue,
                                                      rbi, disk_devt(conf->mddev->gendisk),
                                                      sh->dev[i].sector);
                        if (should_defer && op_is_write(op))
@@ -5090,10 +5090,12 @@ static int raid5_congested(struct mddev *mddev, int bits)
 static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
 {
        struct r5conf *conf = mddev->private;
-       sector_t sector = bio->bi_iter.bi_sector + get_start_sect(bio->bi_bdev);
+       sector_t sector = bio->bi_iter.bi_sector;
        unsigned int chunk_sectors;
        unsigned int bio_sectors = bio_sectors(bio);
 
+       WARN_ON_ONCE(bio->bi_partno);
+
        chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
        return  chunk_sectors >=
                ((sector & (chunk_sectors - 1)) + bio_sectors);
@@ -5229,7 +5231,7 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
                atomic_inc(&rdev->nr_pending);
                rcu_read_unlock();
                raid_bio->bi_next = (void*)rdev;
-               align_bi->bi_bdev =  rdev->bdev;
+               bio_set_dev(align_bi, rdev->bdev);
                bio_clear_flag(align_bi, BIO_SEG_VALID);
 
                if (is_badblock(rdev, align_bi->bi_iter.bi_sector,
@@ -5251,7 +5253,7 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
                spin_unlock_irq(&conf->device_lock);
 
                if (mddev->gendisk)
-                       trace_block_bio_remap(bdev_get_queue(align_bi->bi_bdev),
+                       trace_block_bio_remap(align_bi->bi_disk->queue,
                                              align_bi, disk_devt(mddev->gendisk),
                                              raid_bio->bi_iter.bi_sector);
                generic_make_request(align_bi);