mtd_blkdevs: Set the maximum discards size
authorJarkko Lavinen <jarkko.lavinen@nokia.com>
Mon, 14 Feb 2011 14:16:10 +0000 (16:16 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 14:22:46 +0000 (14:22 +0000)
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>
drivers/mtd/mtd_blkdevs.c

index e0b5f644217145aa7428fc9499cf97fa2aec4d0d..650511304030797052702e55a132497182c2c02c 100644 (file)
@@ -405,9 +405,10 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
        new->rq->queuedata = new;
        blk_queue_logical_block_size(new->rq, tr->blksize);
 
-       if (tr->discard)
-               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,
-                                       new->rq);
+       if (tr->discard) {
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, new->rq);
+               new->rq->limits.max_discard_sectors = UINT_MAX;
+       }
 
        gd->queue = new->rq;