aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Snitzer <[email protected]>2023-11-20 17:29:19 -0500
committerMike Snitzer <[email protected]>2024-02-20 13:43:16 -0500
commit29f0ef873c5ab5d8d59553447e4175e90287e731 (patch)
tree56bf8dd358938bc9bb0b2b7ba394862f9ac4701a
parente752e5c33b960085f1ae12e391b18dd8fc5ceef1 (diff)
dm vdo block-map: optimize enter_zone_read_only_mode
Rather than incrementally dequeue from the zone->flush_waiters vdo_wait_queue, simply re-initialize it. Reviewed-by: Ken Raeburn <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Matthew Sakai <[email protected]>
-rw-r--r--drivers/md/dm-vdo/block-map.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c
index a1f2c9d38192..7f9c4bc05f02 100644
--- a/drivers/md/dm-vdo/block-map.c
+++ b/drivers/md/dm-vdo/block-map.c
@@ -641,12 +641,10 @@ static void enter_zone_read_only_mode(struct block_map_zone *zone, int result)
vdo_enter_read_only_mode(zone->block_map->vdo, result);
/*
- * We are in read-only mode, so we won't ever write any page out. Just take all waiters off
- * the queue so the zone can drain.
+ * We are in read-only mode, so we won't ever write any page out.
+ * Just take all waiters off the waitq so the zone can drain.
*/
- while (vdo_waitq_has_waiters(&zone->flush_waiters))
- vdo_waitq_dequeue_next_waiter(&zone->flush_waiters);
-
+ vdo_waitq_init(&zone->flush_waiters);
check_for_drain_complete(zone);
}