]> www.infradead.org Git - users/hch/block.git/commitdiff
md: drop WRITE_SAME support
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Jan 2022 12:59:15 +0000 (13:59 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 9 Feb 2022 08:25:49 +0000 (09:25 +0100)
There are no more end-users of REQ_OP_WRITE_SAME left, so we can start
deleting it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/md/md-linear.c
drivers/md/md-multipath.c
drivers/md/md.h
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c

index 1ff51647a682243800b2441980962a8d166c68d9..0f55b079371b136abf1fb5c8b338c91f4e7eba6f 100644 (file)
@@ -259,7 +259,6 @@ static bool linear_make_request(struct mddev *mddev, struct bio *bio)
                if (mddev->gendisk)
                        trace_block_bio_remap(bio, disk_devt(mddev->gendisk),
                                              bio_sector);
-               mddev_check_writesame(mddev, bio);
                mddev_check_write_zeroes(mddev, bio);
                submit_bio_noacct(bio);
        }
index 97fb948e3e74141ddf02299fb0e848583c32fc82..68dec76694d53edd9bbec2d3f3b0d2009116d44e 100644 (file)
@@ -127,7 +127,6 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio)
        mp_bh->bio.bi_opf |= REQ_FAILFAST_TRANSPORT;
        mp_bh->bio.bi_end_io = multipath_end_request;
        mp_bh->bio.bi_private = mp_bh;
-       mddev_check_writesame(mddev, &mp_bh->bio);
        mddev_check_write_zeroes(mddev, &mp_bh->bio);
        submit_bio_noacct(&mp_bh->bio);
        return true;
index f1bf3625ef4c9475c524bd23122771a67fc22ec2..6ac28386453368aaadaaf295bbeedae7dad9b5f0 100644 (file)
@@ -797,13 +797,6 @@ static inline void mddev_clear_unsupported_flags(struct mddev *mddev,
        mddev->flags &= ~unsupported_flags;
 }
 
-static inline void mddev_check_writesame(struct mddev *mddev, struct bio *bio)
-{
-       if (bio_op(bio) == REQ_OP_WRITE_SAME &&
-           !bio->bi_bdev->bd_disk->queue->limits.max_write_same_sectors)
-               mddev->queue->limits.max_write_same_sectors = 0;
-}
-
 static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio)
 {
        if (bio_op(bio) == REQ_OP_WRITE_ZEROES &&
index b59a77b31b90d98c4d3b7f05ffc1bf4a20a1ef90..b21e101183f444054ef24a32e6d3ec783392c776 100644 (file)
@@ -402,7 +402,6 @@ static int raid0_run(struct mddev *mddev)
                bool discard_supported = false;
 
                blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
-               blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
                blk_queue_max_write_zeroes_sectors(mddev->queue, mddev->chunk_sectors);
                blk_queue_max_discard_sectors(mddev->queue, UINT_MAX);
 
@@ -594,7 +593,6 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio)
        if (mddev->gendisk)
                trace_block_bio_remap(bio, disk_devt(mddev->gendisk),
                                      bio_sector);
-       mddev_check_writesame(mddev, bio);
        mddev_check_write_zeroes(mddev, bio);
        submit_bio_noacct(bio);
        return true;
index c3288d46948ded595223e2c5066338aff67c93af..9cec48d335065a0c7b4a171b2df87ed9994cbca0 100644 (file)
@@ -3147,10 +3147,8 @@ static int raid1_run(struct mddev *mddev)
        if (IS_ERR(conf))
                return PTR_ERR(conf);
 
-       if (mddev->queue) {
-               blk_queue_max_write_same_sectors(mddev->queue, 0);
+       if (mddev->queue)
                blk_queue_max_write_zeroes_sectors(mddev->queue, 0);
-       }
 
        rdev_for_each(rdev, mddev) {
                if (!mddev->gendisk)
index 5dd2e17e1d0ea1a0cae811d74761adfb4fc666b2..764ca020b7a400beb4a94e0fba95066d09635a34 100644 (file)
@@ -4113,7 +4113,6 @@ static int raid10_run(struct mddev *mddev)
        if (mddev->queue) {
                blk_queue_max_discard_sectors(mddev->queue,
                                              UINT_MAX);
-               blk_queue_max_write_same_sectors(mddev->queue, 0);
                blk_queue_max_write_zeroes_sectors(mddev->queue, 0);
                blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
                raid10_set_io_opt(conf);
index 8891aaba65964e414add3591a1146479fbbd4f22..f5f36fdd3733647d98591b2d23c29cbdbbd21578 100644 (file)
@@ -7767,7 +7767,6 @@ static int raid5_run(struct mddev *mddev)
                mddev->queue->limits.discard_alignment = stripe;
                mddev->queue->limits.discard_granularity = stripe;
 
-               blk_queue_max_write_same_sectors(mddev->queue, 0);
                blk_queue_max_write_zeroes_sectors(mddev->queue, 0);
 
                rdev_for_each(rdev, mddev) {