Thread (6 messages) 6 messages, 2 authors, 2022-09-20
STALE1390d
Revisions (4)
  1. v1 [diff vs current]
  2. v2 current
  3. v4 [diff vs current]
  4. v5 [diff vs current]

[PATCH v2 2/3] block: add a helper to check elevator name

From: Yu Kuai <hidden>
Date: 2022-09-19 06:58:53
Also in: lkml
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

From: Yu Kuai <redacted>

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help