[PATCH 2/3] mtd_blkdevs: Set the maximum discards size
Jarkko Lavinen
jarkko.lavinen at nokia.com
Mon Feb 14 09:16:10 EST 2011
Set max_discard_sectors to UINT_MAX.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen at nokia.com>
---
drivers/mtd/mtd_blkdevs.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 69d8c27..6ba450a 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -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;
--
1.7.2.3
More information about the linux-mtd
mailing list