From d970b407fc0f4fba35fc31aab80ea6ea69788a52 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 25 Feb 2023 17:20:16 +0100 Subject: Merging upstream version 4.2+20230223. Signed-off-by: Daniel Baumann --- managemon.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'managemon.c') diff --git a/managemon.c b/managemon.c index bb7334c..a7bfa8f 100644 --- a/managemon.c +++ b/managemon.c @@ -106,7 +106,6 @@ #include "mdmon.h" #include #include -#include static void close_aa(struct active_array *aa) { @@ -208,7 +207,7 @@ static void replace_array(struct supertype *container, remove_old(); while (pending_discard) { while (discard_this == NULL) - sleep(1); + sleep_for(1, 0, true); remove_old(); } pending_discard = old; @@ -569,7 +568,7 @@ static void manage_member(struct mdstat_ent *mdstat, updates = NULL; while (update_queue_pending || update_queue) { check_update_queue(container); - usleep(15*1000); + sleep_for(0, MSEC_TO_NSEC(15), true); } replace_array(container, a, newa); if (sysfs_set_str(&a->info, NULL, @@ -823,7 +822,7 @@ static void handle_message(struct supertype *container, struct metadata_update * if (msg->len <= 0) while (update_queue_pending || update_queue) { check_update_queue(container); - usleep(15*1000); + sleep_for(0, MSEC_TO_NSEC(15), true); } if (msg->len == 0) { /* ping_monitor */ @@ -837,7 +836,7 @@ static void handle_message(struct supertype *container, struct metadata_update * wakeup_monitor(); while (monitor_loop_cnt - cnt < 0) - usleep(10 * 1000); + sleep_for(0, MSEC_TO_NSEC(10), true); } else if (msg->len == -1) { /* ping_manager */ struct mdstat_ent *mdstat = mdstat_read(1, 0); -- cgit v1.2.3