Commit 115ee88c15b55859a8b59c5dccb3882bbd47e542

Authored by Jarkko Lavinen
Committed by David Woodhouse
1 parent c7519dbf6f

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>

Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff

drivers/mtd/mtd_blkdevs.c
... ... @@ -405,9 +405,10 @@
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