From 8cafdb5ab94cda3ebb0975be16e2d564a05132ea Mon Sep 17 00:00:00 2001
From: Pankaj Raghav
Date: Thu, 29 Sep 2022 09:47:44 +0200
Subject: block: adapt blk_mq_plug() to not plug for writes that require a zone
lock
The current implementation of blk_mq_plug() disables plugging for all
operations that involves a transfer to the device as we just check if
the last bit in op_is_write() function.
Modify blk_mq_plug() to disable plugging only for REQ_OP_WRITE and
REQ_OP_WRITE_ZEROS as they might require a zone lock.
Suggested-by: Christoph Hellwig
Suggested-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
Signed-off-by: Pankaj Raghav
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
Link: https://lore.kernel.org/r/20220929074745.103073-2-p.raghav@samsung.com
Signed-off-by: Jens Axboe
---
block/blk-mq.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'block/blk-mq.h')
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 8ca453ac243d..0b2870839cdd 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -312,7 +312,8 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
static inline struct blk_plug *blk_mq_plug( struct bio *bio)
{
/* Zoned block device write operation case: do not plug the BIO */
- if (bdev_is_zoned(bio->bi_bdev) && op_is_write(bio_op(bio)))
+ if (IS_ENABLED(CONFIG_BLK_DEV_ZONED) &&
+ bdev_op_is_zoned_write(bio->bi_bdev, bio_op(bio)))
return NULL;
/*
--
cgit v1.2.3