Patchwork mtd: mark block device queue as non-rotational

login
register
mail settings
Submitter Dan McGee
Date Sept. 28, 2011, 5:21 a.m.
Message ID <1317187302-13380-1-git-send-email-dpmcgee@gmail.com>
Download mbox | patch
Permalink /patch/116695/
State Accepted
Commit 16f7eca5871ad09b8f6c44ba8cb4d8185833a1ee
Headers show

Comments

Dan McGee - Sept. 28, 2011, 5:21 a.m.
This is similar to what the nbd driver does, among others.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
 drivers/mtd/mtd_blkdevs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Artem Bityutskiy - Oct. 14, 2011, 8:34 a.m.
On Wed, 2011-09-28 at 00:21 -0500, Dan McGee wrote:
> This is similar to what the nbd driver does, among others.
> 
> Signed-off-by: Dan McGee <dpmcgee@gmail.com>

Pushed to l2-mtd-2.6.git, thanks!

Patch

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index ca38569..ed8b5e7 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -426,6 +426,8 @@  int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
 	new->rq->queuedata = new;
 	blk_queue_logical_block_size(new->rq, tr->blksize);
 
+	queue_flag_set_unlocked(QUEUE_FLAG_NONROT, new->rq);
+
 	if (tr->discard) {
 		queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, new->rq);
 		new->rq->limits.max_discard_sectors = UINT_MAX;