X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fselftest%2Fselftest.h;h=386da3b0b8b024da001e21ea4bc5ce1a6f1e7419;hb=c8e9c0cdd3f82385f5f088b61f677e62f063517f;hp=061d7669a9426481133d7ee2cb8e5e190c5be418;hpb=33984c012883a7c714429d2c612cf6dcda191974;p=fs%2Flustre-release.git diff --git a/lnet/selftest/selftest.h b/lnet/selftest/selftest.h index 061d766..386da3b 100644 --- a/lnet/selftest/selftest.h +++ b/lnet/selftest/selftest.h @@ -43,16 +43,8 @@ #define LNET_ONLY -#ifndef __KERNEL__ - -/* XXX workaround XXX */ -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#endif #include -#include +#include #include #include #include @@ -167,12 +159,7 @@ typedef struct { lnet_handle_md_t bk_mdh; int bk_sink; /* sink/source */ int bk_niov; /* # iov in bk_iovs */ -#ifdef __KERNEL__ lnet_kiov_t bk_iovs[0]; -#else - struct page **bk_pages; - lnet_md_iovec_t bk_iovs[0]; -#endif } srpc_bulk_t; /* bulk descriptor */ /* message buffer descriptor */ @@ -189,7 +176,7 @@ typedef int (*swi_action_t) (struct swi_workitem *); typedef struct swi_workitem { struct cfs_wi_sched *swi_sched; - cfs_workitem_t swi_workitem; + struct cfs_workitem swi_workitem; swi_action_t swi_action; int swi_state; } swi_workitem_t; @@ -473,7 +460,7 @@ srpc_serv_is_framework(struct srpc_service *svc) } static inline int -swi_wi_action(cfs_workitem_t *wi) +swi_wi_action(struct cfs_workitem *wi) { swi_workitem_t *swi = container_of(wi, swi_workitem_t, swi_workitem); @@ -508,14 +495,6 @@ swi_deschedule_workitem(swi_workitem_t *swi) return cfs_wi_deschedule(swi->swi_sched, &swi->swi_workitem); } -#ifndef __KERNEL__ -static inline int -swi_check_events(void) -{ - return cfs_wi_check_events(); -} -#endif - int sfw_startup(void); int srpc_startup(void); void sfw_shutdown(void); @@ -527,9 +506,6 @@ srpc_destroy_client_rpc (srpc_client_rpc_t *rpc) LASSERT (rpc != NULL); LASSERT (!srpc_event_pending(rpc)); LASSERT (atomic_read(&rpc->crpc_refcount) == 0); -#ifndef __KERNEL__ - LASSERT (rpc->crpc_bulk.bk_pages == NULL); -#endif if (rpc->crpc_fini == NULL) { LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc)); @@ -598,24 +574,6 @@ swi_state2str (int state) #undef STATE2STR } -#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; \ @@ -624,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)); \ } \ @@ -637,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;