mtd_blkdevs: Set the maximum discards size

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Mar 11 10:59:05 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=115ee88c15b55859a8b59c5dccb3882bbd47e542
Commit:     115ee88c15b55859a8b59c5dccb3882bbd47e542
Parent:     c7519dbf6f4b4408229d279d799c938ffdd06f21
Author:     Jarkko Lavinen <jarkko.lavinen at nokia.com>
AuthorDate: Mon Feb 14 16:16:10 2011 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Mar 11 14:22:46 2011 +0000

    mtd_blkdevs: Set the maximum discards size
    
    Set max_discard_sectors to UINT_MAX.
    
    Signed-off-by: Jarkko Lavinen <jarkko.lavinen at nokia.com>
    Tested-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.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 e0b5f64..6505113 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;
 



More information about the linux-mtd-cvs mailing list