diff options
author | Joe Lawrence <Joe.Lawrence@stratus.com> | 2013-02-20 21:28:09 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-02-25 19:55:21 -0500 |
commit | c8dc9c654794a765ca61baed07f84ed8aaa7ca8c (patch) | |
tree | 81dea728ef7bcaa01fb7e06c1e731d76dd258dff /drivers/md/raid1.c | |
parent | bbfa57c0f2243a7c31fd248d22e9861a2802cad5 (diff) |
md: raid1,10: Handle REQ_WRITE_SAME flag in write bios
Set mddev queue's max_write_same_sectors to its chunk_sector value (before
disk_stack_limits merges the underlying disk limits.) With that in place,
be sure to handle writes coming down from the block layer that have the
REQ_WRITE_SAME flag set. That flag needs to be copied into any newly cloned
write bio.
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d5bddfc4010e..6e5d5a5f9cb4 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1000,6 +1000,7 @@ static void make_request(struct mddev *mddev, struct bio * bio) | |||
1000 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); | 1000 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); |
1001 | const unsigned long do_discard = (bio->bi_rw | 1001 | const unsigned long do_discard = (bio->bi_rw |
1002 | & (REQ_DISCARD | REQ_SECURE)); | 1002 | & (REQ_DISCARD | REQ_SECURE)); |
1003 | const unsigned long do_same = (bio->bi_rw & REQ_WRITE_SAME); | ||
1003 | struct md_rdev *blocked_rdev; | 1004 | struct md_rdev *blocked_rdev; |
1004 | struct blk_plug_cb *cb; | 1005 | struct blk_plug_cb *cb; |
1005 | struct raid1_plug_cb *plug = NULL; | 1006 | struct raid1_plug_cb *plug = NULL; |
@@ -1301,7 +1302,8 @@ read_again: | |||
1301 | conf->mirrors[i].rdev->data_offset); | 1302 | conf->mirrors[i].rdev->data_offset); |
1302 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; | 1303 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; |
1303 | mbio->bi_end_io = raid1_end_write_request; | 1304 | mbio->bi_end_io = raid1_end_write_request; |
1304 | mbio->bi_rw = WRITE | do_flush_fua | do_sync | do_discard; | 1305 | mbio->bi_rw = |
1306 | WRITE | do_flush_fua | do_sync | do_discard | do_same; | ||
1305 | mbio->bi_private = r1_bio; | 1307 | mbio->bi_private = r1_bio; |
1306 | 1308 | ||
1307 | atomic_inc(&r1_bio->remaining); | 1309 | atomic_inc(&r1_bio->remaining); |
@@ -2818,6 +2820,9 @@ static int run(struct mddev *mddev) | |||
2818 | if (IS_ERR(conf)) | 2820 | if (IS_ERR(conf)) |
2819 | return PTR_ERR(conf); | 2821 | return PTR_ERR(conf); |
2820 | 2822 | ||
2823 | if (mddev->queue) | ||
2824 | blk_queue_max_write_same_sectors(mddev->queue, | ||
2825 | mddev->chunk_sectors); | ||
2821 | rdev_for_each(rdev, mddev) { | 2826 | rdev_for_each(rdev, mddev) { |
2822 | if (!mddev->gendisk) | 2827 | if (!mddev->gendisk) |
2823 | continue; | 2828 | continue; |