All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: paolo.valente@linaro.org, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com
Subject: [PATCH v2 2/3] block: add a helper to check elevator name
Date: Mon, 19 Sep 2022 15:09:15 +0800	[thread overview]
Message-ID: <20220919070916.2738443-3-yukuai1@huaweicloud.com> (raw)
In-Reply-To: <20220919070916.2738443-1-yukuai1@huaweicloud.com>

From: Yu Kuai <yukuai3@huawei.com>

The helper will be used in later patch to make sure wbt is not enabled
if default io scheduler is bfq.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/elevator.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/elevator.h b/block/elevator.h
index 3f0593b3bf9d..2ddc738cae97 100644
--- a/block/elevator.h
+++ b/block/elevator.h
@@ -104,6 +104,11 @@ struct elevator_queue
 	DECLARE_HASHTABLE(hash, ELV_HASH_BITS);
 };
 
+static inline bool check_elevator_name(struct elevator_queue *elevator,
+				       const char *name)
+{
+	return elevator && !strcmp(elevator->type->elevator_name, name);
+}
 /*
  * block elevator interface
  */
-- 
2.31.1


  parent reply	other threads:[~2022-09-19  6:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  7:09 [PATCH v2 0/3] blk-wbt: simple improvment to enable wbt correctly Yu Kuai
2022-09-19  7:09 ` [PATCH v2 1/3] wbt: don't show valid wbt_lat_usec in sysfs while wbt is disabled Yu Kuai
2022-09-19  7:09 ` Yu Kuai [this message]
2022-09-19  7:09 ` [PATCH v2 3/3] blk-wbt: don't enable throttling if default elevator is bfq Yu Kuai
2022-09-20  7:25   ` Christoph Hellwig
2022-09-20  7:48     ` Yu Kuai

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=20220919070916.2738443-3-yukuai1@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.