nbd: set discard granularity properly
authorJosef Bacik <jbacik@fb.com>
Wed, 23 May 2018 17:35:59 +0000 (13:35 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 May 2018 21:27:26 +0000 (15:27 -0600)
commit6df133a1495f8c497d0f53005296ef5421752620
tree60b79b815157ca3664ecbc8f3586126da7b8dfb5
parent327ea4adcfa37194739f1ec7c70568944d292281
nbd: set discard granularity properly

For some reason we had discard granularity set to 512 always even when
discards were disabled.  Fix this by having the default be 0, and then
if we turn it on set the discard granularity to the blocksize.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c