X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fselftest%2Fselftest.h;h=830418c191f75c6fa85250b2fdcd05fff70cd2dd;hb=f6995cf04407dff15d6ca79ca44cfa97dc6eb014;hp=9c0100bcad7d6d3d201d6d3e3b7a91d8eeca83af;hpb=faeb94fe81e4646b3121c263521d30e0e83fa71f;p=fs%2Flustre-release.git diff --git a/lnet/selftest/selftest.h b/lnet/selftest/selftest.h index 9c0100b..830418c 100644 --- a/lnet/selftest/selftest.h +++ b/lnet/selftest/selftest.h @@ -44,7 +44,7 @@ #define LNET_ONLY #include -#include +#include #include #include #include @@ -574,8 +574,6 @@ swi_state2str (int state) #undef STATE2STR } -#define selftest_wait_events() cfs_pause(cfs_time_seconds(1) / 10) - #define lst_wait_until(cond, lock, fmt, ...) \ do { \ int __I = 2; \ @@ -584,7 +582,8 @@ do { \ fmt, ## __VA_ARGS__); \ spin_unlock(&(lock)); \ \ - selftest_wait_events(); \ + set_current_state(TASK_UNINTERRUPTIBLE); \ + schedule_timeout(cfs_time_seconds(1) / 10); \ \ spin_lock(&(lock)); \ } \ @@ -597,13 +596,14 @@ srpc_wait_service_shutdown(srpc_service_t *sv) LASSERT(sv->sv_shuttingdown); - while (srpc_finish_service(sv) == 0) { - i++; - CDEBUG (((i & -i) == i) ? D_WARNING : D_NET, - "Waiting for %s service to shutdown...\n", - sv->sv_name); - selftest_wait_events(); - } + while (srpc_finish_service(sv) == 0) { + i++; + CDEBUG(((i & -i) == i) ? D_WARNING : D_NET, + "Waiting for %s service to shutdown...\n", + sv->sv_name); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(cfs_time_seconds(1) / 10); + } } extern sfw_test_client_ops_t ping_test_client;