]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: rename and simplify disk_get_and_lock_zone_wplug()
authorDamien Le Moal <dlemoal@kernel.org>
Fri, 27 Feb 2026 13:19:46 +0000 (22:19 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Mar 2026 20:30:00 +0000 (14:30 -0600)
commit1084e41deeada93eebfd83572cf29029c24e5443
tree9afed68446b00b7af2f08665ce546a1a91a48247
parent0a8b8af896e0ef83e188e1fe20f98f2bbb1c2459
block: rename and simplify disk_get_and_lock_zone_wplug()

disk_get_and_lock_zone_wplug() always returns a zone write plug with the
plug lock held. This is unnecessary since this function does not look at
the fields of existing plugs, and new plugs need to be locked only after
their insertion in the disk hash table, when they are being used.

Remove the zone write plug locking from disk_get_and_lock_zone_wplug()
and rename this function disk_get_or_alloc_zone_wplug().
blk_zone_wplug_handle_write() is modified to add locking of the zone
write plug after calling disk_get_or_alloc_zone_wplug() and before
starting to use the plug. This change also simplifies
blk_revalidate_seq_zone() as unlocking the plug becomes unnecessary.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-zoned.c