diff options
author | Christoph Hellwig <hch@lst.de> | 2017-04-05 19:21:22 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-08 11:25:38 -0600 |
commit | 45c21793a6601b29926d67f7a07fe4077a45072e (patch) | |
tree | e4ece67aa634a002b696697d904f5340b13fe970 /drivers/block/drbd/drbd_nl.c | |
parent | 0dbed96a3cc9786bc4814dab98a7218753bde934 (diff) | |
download | linux-rt-45c21793a6601b29926d67f7a07fe4077a45072e.tar.gz |
drbd: implement REQ_OP_WRITE_ZEROES
It seems like DRBD assumes its on the wire TRIM request always zeroes data.
Use that fact to implement REQ_OP_WRITE_ZEROES.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 908c704e20aa..e4516d3b971d 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1217,10 +1217,12 @@ static void decide_on_discard_support(struct drbd_device *device, blk_queue_discard_granularity(q, 512); q->limits.max_discard_sectors = drbd_max_discard_sectors(connection); queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); + q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection); } else { queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); blk_queue_discard_granularity(q, 0); q->limits.max_discard_sectors = 0; + q->limits.max_write_zeroes_sectors = 0; } } |