[PATCH v16 02/26] blk-zoned: Split disk_zone_wplugs_work()

Bart Van Assche
2024-11-19T00:28:37Z

Prepare for adding a second disk_zone_process_err_list() call.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
block/blk-zoned.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 3346b8c53605..e5c8ab1eab9f 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -1341,10 +1341,8 @@ static void disk_zone_wplug_handle_error(struct gendisk *disk,
disk_put_zone_wplug(zwplug);
}

-static void disk_zone_wplugs_work(struct work_struct *work)
+static void disk_zone_process_err_list(struct gendisk *disk)
{
- struct gendisk *disk =
- container_of(work, struct gendisk, zone_wplugs_work);
struct blk_zone_wplug *zwplug;
unsigned long flags;

@@ -1365,6 +1363,14 @@ static void disk_zone_wplugs_work(struct work_struct *work)
spin_unlock_irqrestore(&disk->zone_wplugs_lock, flags);
}

+static void disk_zone_wplugs_work(struct work_struct *work)
+{
+ struct gendisk *disk =
+ container_of(work, struct gendisk, zone_wplugs_work);
+
+ disk_zone_process_err_list(disk);
+}
+
static inline unsigned int disk_zone_wplugs_hash_size(struct gendisk *disk)
{
return 1U << disk->zone_wplugs_hash_bits;