Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd_blkdevs: Set the maximum discards size

Set max_discard_sectors to UINT_MAX.

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Jarkko Lavinen and committed by
David Woodhouse
115ee88c c7519dbf

+4 -3
+4 -3
drivers/mtd/mtd_blkdevs.c
··· 405 405 new->rq->queuedata = new; 406 406 blk_queue_logical_block_size(new->rq, tr->blksize); 407 407 408 - if (tr->discard) 409 - queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, 410 - new->rq); 408 + if (tr->discard) { 409 + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, new->rq); 410 + new->rq->limits.max_discard_sectors = UINT_MAX; 411 + } 411 412 412 413 gd->queue = new->rq; 413 414