[PATCH 3/6] block: add a bool member to request_queue for power_of_2 emulation

Pankaj Raghav
2022-03-08T17:07:39Z

A new member is added to request_queue struct to indicate if power_of_2
emulation is enabled. Helpers are also added to get and set that member.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
include/linux/blkdev.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 08cf039c1622..3a5d5ddc779c 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -463,6 +463,7 @@ struct request_queue {
unsigned long *seq_zones_wlock;
unsigned int max_open_zones;
unsigned int max_active_zones;
+ bool po2_zone_emu;
#endif /* CONFIG_BLK_DEV_ZONED */

int node;
@@ -705,6 +706,18 @@ static inline unsigned int queue_max_active_zones(const struct request_queue *q)
{
return q->max_active_zones;
}
+
+static inline void blk_queue_po2_zone_emu(struct request_queue *q,
+ bool po2_zone_emu)
+{
+ q->po2_zone_emu = po2_zone_emu;
+}
+
+static inline bool blk_queue_is_po2_zone_emu(struct request_queue *q)
+{
+ return q->po2_zone_emu;
+}
+
#else /* CONFIG_BLK_DEV_ZONED */
static inline unsigned int blk_queue_nr_zones(struct request_queue *q)
{
@@ -728,6 +741,17 @@ static inline unsigned int queue_max_active_zones(const struct request_queue *q)
{
return 0;
}
+
+static inline bool blk_queue_is_po2_zone_emu(struct request_queue *q)
+{
+ return false;
+}
+
+static inline void blk_queue_po2_zone_emu(struct request_queue *q,
+ unsigned int po2_zone_emu)
+{
+}
+
#endif /* CONFIG_BLK_DEV_ZONED */

static inline unsigned int blk_queue_depth(struct request_queue *q)
--
2.25.1