aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2014-04-07 19:52:03 -0400
committerIlya Dryomov <idryomov@redhat.com>2014-10-14 13:03:37 -0400
commitb76f82398c1017e303d87760e22125714010207f (patch)
tree9b607589ee16f3f9da01849a75733717c818b2c9 /drivers/block
parentd3246fb0da5d70838469c01d5b6b11163b49cd86 (diff)
rbd: set the remaining discard properties to enable support
max_discard_sectors must be set for the queue to support discard. Operations implementing discard for rbd zero data, so report that. Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e1dcd36ae072..7712ae65753c 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3764,6 +3764,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
3764 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 3764 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
3765 q->limits.discard_granularity = segment_size; 3765 q->limits.discard_granularity = segment_size;
3766 q->limits.discard_alignment = segment_size; 3766 q->limits.discard_alignment = segment_size;
3767 q->limits.max_discard_sectors = segment_size / SECTOR_SIZE;
3768 q->limits.discard_zeroes_data = 1;
3767 3769
3768 blk_queue_merge_bvec(q, rbd_merge_bvec); 3770 blk_queue_merge_bvec(q, rbd_merge_bvec);
3769 disk->queue = q; 3771 disk->queue = q;