Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Jeffle Xu <jefflexu@linux.alibaba.com>
To: davem@davemloft.net
Cc: linux-ide@vger.kernel.org, joseph.qi@linux.alibaba.com,
	Jeffle Xu <jefflexu@linux.alibaba.com>
Subject: [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM
Date: Tue,  9 Feb 2021 16:10:13 +0800	[thread overview]
Message-ID: <20210209081013.38979-1-jefflexu@linux.alibaba.com> (raw)

While the whole block layer has migrated to mq framework,
QUEUE_FLAG_ADD_RANDOM is not included in QUEUE_FLAG_MQ_DEFAULT as the
default flags.

Keep 'blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, ...)' there as the
statement is self explanatory. Besides it can make the code stronger
to keep a complete if-clear-else-set statement, no matter how
QUEUE_FLAG_MQ_DEFAULT could be refactored.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 drivers/ide/ide-disk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 34b9441084f8..7f19af48a6e7 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -688,6 +688,9 @@ static void ide_disk_setup(ide_drive_t *drive)
 	if (ata_id_is_ssd(id)) {
 		blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
 		blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
+	} else {
+		blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
+		blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
 	}
 
 	/* calculate drive capacity, and select LBA if possible */
-- 
2.27.0


             reply	other threads:[~2021-02-09  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09  8:10 Jeffle Xu [this message]
2021-02-09  8:32 ` [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM Christoph Hellwig
2021-02-09  9:00   ` JeffleXu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210209081013.38979-1-jefflexu@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox