-#else /* __KERNEL__ */
-
-int
-cfs_wi_check_events (void)
-{
- int n = 0;
- cfs_workitem_t *wi;
-
- spin_lock(&cfs_wi_data.wi_glock);
-
- for (;;) {
- struct cfs_wi_sched *sched = NULL;
- struct cfs_wi_sched *tmp;
-
- /** rerunq is always empty for userspace */
- cfs_list_for_each_entry(tmp,
- &cfs_wi_data.wi_scheds, ws_list) {
- if (!cfs_list_empty(&tmp->ws_runq)) {
- sched = tmp;
- break;
- }
- }
-
- if (sched == NULL)
- break;
-
- wi = cfs_list_entry(sched->ws_runq.next,
- cfs_workitem_t, wi_list);
- cfs_list_del_init(&wi->wi_list);
-
- LASSERT(sched->ws_nscheduled > 0);
- sched->ws_nscheduled--;
-
- LASSERT(wi->wi_scheduled);
- wi->wi_scheduled = 0;
- spin_unlock(&cfs_wi_data.wi_glock);
-
- n++;
- (*wi->wi_action) (wi);
-
- spin_lock(&cfs_wi_data.wi_glock);
- }
-
- spin_unlock(&cfs_wi_data.wi_glock);
- return n;
-}
-
-#endif
-