linux/drivers/md/dm-snap.c
Jiangong.Han c92d632f86 dm: use clear_and_wake_up_bit() in device mapper
The helper was introduced in 'commit 8236b0ae31 ("bdi: wake up
concurrent wb_shutdown() callers.")' as a generic way of doing the same
sequence of operations:
	clear_bit_unlock();
	smp_mb__after_atomic();
	wake_up_bit();

The helper was first implemented to avoid bugs caused by forgetting to
call `wake_up_bit()` after `clear_bit_unlock()`. Replace the open-coded
sequence with the helper to avoid duplicate code and reduce code paths
to maintain.

Suggested-by: code@agatha.dev
Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_001
Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_002
Signed-off-by: Jiangong.Han <jiangong.han@windriver.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2026-07-15 15:58:05 +02:00

2855 lines
68 KiB