]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: Introduce bio_needs_zone_write_plugging()
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 25 Jun 2025 09:33:24 +0000 (18:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:36:28 +0000 (18:36 +0200)
commit4b3f4afaea18d6e8b1fe076d460d843b4539b40f
treec851851936130c4a80881f22d814690354867d4d
parent93795b80af37db6e4c59baae46d592a1edbbc399
block: Introduce bio_needs_zone_write_plugging()

commit f70291411ba20d50008db90a6f0731efac27872c upstream.

In preparation for fixing device mapper zone write handling, introduce
the inline helper function bio_needs_zone_write_plugging() to test if a
BIO requires handling through zone write plugging using the function
blk_zone_plug_bio(). This function returns true for any write
(op_is_write(bio) == true) operation directed at a zoned block device
using zone write plugging, that is, a block device with a disk that has
a zone write plug hash table.

This helper allows simplifying the check on entry to blk_zone_plug_bio()
and used in to protect calls to it for blk-mq devices and DM devices.

Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250625093327.548866-3-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-mq.c
block/blk-zoned.c
drivers/md/dm.c
include/linux/blkdev.h