rbd: set the remaining discard properties to enable support
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 7 Apr 2014 23:52:03 +0000 (16:52 -0700)
committerIlya Dryomov <idryomov@redhat.com>
Tue, 14 Oct 2014 17:03:37 +0000 (21:03 +0400)
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>
drivers/block/rbd.c

index e1dcd36ae0721d6d5b6003d66102a49275ce8f58..7712ae65753caeaaf5be57eb32dfdc929c4aed11 100644 (file)
@@ -3764,6 +3764,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
        queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
        q->limits.discard_granularity = segment_size;
        q->limits.discard_alignment = segment_size;
+       q->limits.max_discard_sectors = segment_size / SECTOR_SIZE;
+       q->limits.discard_zeroes_data = 1;
 
        blk_queue_merge_bvec(q, rbd_merge_bvec);
        disk->queue = q;