-#define UNUSED(x) ( (void)(x) )
-
-#ifndef __KERNEL__
-
-int stt_poll_interval(void);
-int sfw_session_removed(void);
-
-int stt_check_events(void);
-int srpc_check_event(int timeout);
-
-int lnet_selftest_init(void);
-void lnet_selftest_fini(void);
-int selftest_wait_events(void);
-
-#else
-
-#define selftest_wait_events() cfs_pause(cfs_time_seconds(1) / 10)
-
-#endif
-
-#define lst_wait_until(cond, lock, fmt, ...) \
-do { \
- int __I = 2; \
- while (!(cond)) { \
- CDEBUG(IS_PO2(++__I) ? D_WARNING : D_NET, \
- fmt, ## __VA_ARGS__); \
- cfs_spin_unlock(&(lock)); \
- \
- selftest_wait_events(); \
- \
- cfs_spin_lock(&(lock)); \
- } \
+#define lst_wait_until(cond, lock, fmt, ...) \
+do { \
+ int __I = 2; \
+ while (!(cond)) { \
+ CDEBUG(IS_PO2(++__I) ? D_WARNING : D_NET, \
+ fmt, ## __VA_ARGS__); \
+ spin_unlock(&(lock)); \
+ \
+ set_current_state(TASK_UNINTERRUPTIBLE); \
+ schedule_timeout(cfs_time_seconds(1) / 10); \
+ \
+ spin_lock(&(lock)); \
+ } \