Change blk_queue_max_discard_sectors from bytes to sector to be more clearly. Signed-off-by: Hou Pu <houpu@xxxxxxxxxxxxx> --- drivers/block/nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 59c6ce2d2e43..8c59ada4be64 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -304,7 +304,7 @@ static void nbd_size_update(struct nbd_device *nbd) if (config->flags & NBD_FLAG_SEND_TRIM) { nbd->disk->queue->limits.discard_granularity = config->blksize; nbd->disk->queue->limits.discard_alignment = config->blksize; - blk_queue_max_discard_sectors(nbd->disk->queue, UINT_MAX); + blk_queue_max_discard_sectors(nbd->disk->queue, UINT_MAX >> 9); } blk_queue_logical_block_size(nbd->disk->queue, config->blksize); blk_queue_physical_block_size(nbd->disk->queue, config->blksize); @@ -1224,7 +1224,7 @@ static void nbd_config_put(struct nbd_device *nbd) nbd->tag_set.timeout = 0; nbd->disk->queue->limits.discard_granularity = 0; nbd->disk->queue->limits.discard_alignment = 0; - blk_queue_max_discard_sectors(nbd->disk->queue, UINT_MAX); + blk_queue_max_discard_sectors(nbd->disk->queue, UINT_MAX >> 9); blk_queue_flag_clear(QUEUE_FLAG_DISCARD, nbd->disk->queue); mutex_unlock(&nbd->config_lock); -- 2.11.0