From 3608e8aee74a5c771b96d768e6c32edc728dbca0 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 12 Mar 2021 13:07:05 +0100 Subject: [PATCH] cache: use interruptible_usleep Reuse code for interruptible sleeping. --- lib/metadata/cache_manip.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c index 3eac736dd..98821430f 100644 --- a/lib/metadata/cache_manip.c +++ b/lib/metadata/cache_manip.c @@ -470,13 +470,7 @@ int lv_cache_wait_for_clean(struct logical_volume *cache_lv, int *is_clean) //FIXME: use polling to do this... for (;;) { - sigint_allow(); - if (cleaner_policy) - /* TODO: Use centralized place */ - usleep(500000); - sigint_restore(); - if (sigint_caught()) { - sigint_clear(); + if (cleaner_policy && interruptible_usleep(500000)) { log_error("Flushing of %s aborted.", display_lvname(cache_lv)); if (cache_seg->cleaner_policy) { cache_seg->cleaner_policy = 0;