diff --git a/libcfs/include/libcfs/posix/libcfs.h b/libcfs/include/libcfs/posix/libcfs.h index 95035d29c572dc36148112e38a2de18974d994f3..909deeffa08819ec48c03244972f144b99b95678 100644 --- a/libcfs/include/libcfs/posix/libcfs.h +++ b/libcfs/include/libcfs/posix/libcfs.h @@ -307,7 +307,7 @@ struct radix_tree_node { unsigned long index; void *item; }; - + #define RADIX_TREE_INIT(mask) { \ NOT_IMPLEMENTED \ } @@ -334,7 +334,7 @@ static inline int radix_tree_insert(struct radix_tree_root *root, node->index = idx; node->item = item; list_add_tail(&node->_node, &root->list); - root->rnode = (void *)1001; + root->rnode = (void *)1001; return 0; } diff --git a/libcfs/libcfs/linux/linux-prim.c b/libcfs/libcfs/linux/linux-prim.c index 9019b3fd88ef8ee1a27e46aac2f8820c0f90c571..18f81b4c27b61b02ae4ec24b8894cb8999de67e0 100644 --- a/libcfs/libcfs/linux/linux-prim.c +++ b/libcfs/libcfs/linux/linux-prim.c @@ -335,6 +335,7 @@ libcfs_arch_cleanup(void) EXPORT_SYMBOL(libcfs_arch_init); EXPORT_SYMBOL(libcfs_arch_cleanup); +EXPORT_SYMBOL(cfs_enter_debugger); EXPORT_SYMBOL(cfs_daemonize); EXPORT_SYMBOL(cfs_daemonize_ctxt); EXPORT_SYMBOL(cfs_block_allsigs); diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index de9c8e9024b1887ee818e1db9f61f3d10cf949bd..6913c44f37cce674ced1b3ae2525e51b6c1c7e28 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -151,7 +151,7 @@ static struct trace_page *trace_get_tage_try(struct trace_cpu_data *tcd, tage = tage_alloc(CFS_ALLOC_ATOMIC); if (tage == NULL) { if (printk_ratelimit()) - printk(KERN_WARNING + printk(KERN_WARNING "cannot allocate a tage (%ld)\n", tcd->tcd_cur_pages); return NULL; @@ -196,7 +196,7 @@ static void tcd_shrink(struct trace_cpu_data *tcd) CFS_INIT_LIST_HEAD(&pc.pc_pages); spin_lock_init(&pc.pc_lock); - cfs_list_for_each_entry_safe_typed(tage, tmp, &tcd->tcd_pages, + cfs_list_for_each_entry_safe_typed(tage, tmp, &tcd->tcd_pages, struct trace_page, linkage) { if (pgcount-- == 0) break; @@ -451,6 +451,7 @@ libcfs_assertion_failed(const char *expr, const char *file, { libcfs_debug_msg(NULL, 0, D_EMERG, file, func, line, "ASSERTION(%s) failed\n", expr); + /* cfs_enter_debugger(); */ lbug_with_loc(file, func, line); } EXPORT_SYMBOL(libcfs_assertion_failed); diff --git a/libcfs/libcfs/user-lock.c b/libcfs/libcfs/user-lock.c index cee36d75cdc192558c05b21ec727b581a0d2c129..d36a17b3c170cddf96d797d0850dd43c9d25ebdc 100644 --- a/libcfs/libcfs/user-lock.c +++ b/libcfs/libcfs/user-lock.c @@ -172,7 +172,7 @@ void wait_for_completion(struct completion *c) { LASSERT(c != NULL); do { - if (wait_handler) + if (wait_handler) wait_handler(1000); else break; @@ -183,7 +183,7 @@ int wait_for_completion_interruptible(struct completion *c) { LASSERT(c != NULL); do { - if (wait_handler) + if (wait_handler) wait_handler(1000); else break; diff --git a/libcfs/libcfs/user-prim.c b/libcfs/libcfs/user-prim.c index bf57b4c9e84be8c1b797958c4368c27a407eac68..4c52964f58944f751f5c02f69eb18d1ca3953b9d 100644 --- a/libcfs/libcfs/user-prim.c +++ b/libcfs/libcfs/user-prim.c @@ -119,7 +119,7 @@ void cfs_waitq_wait(struct cfs_waitlink *link, cfs_task_state_t state) (void)link; } -int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state, +int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state, int64_t timeout) { LASSERT(link != NULL); @@ -129,16 +129,16 @@ int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state, void cfs_schedule_timeout(cfs_task_state_t state, int64_t timeout) { - cfs_waitlink_t l; + cfs_waitlink_t l; /* sleep(timeout) here instead? */ cfs_waitq_timedwait(&l, state, timeout); } -void +void cfs_pause(cfs_duration_t d) { struct timespec s; - + cfs_duration_nsec(d, &s); nanosleep(&s, NULL); } @@ -198,7 +198,7 @@ cfs_time_t cfs_timer_deadline(cfs_timer_t *l) */ struct lustre_thread_arg { - cfs_thread_t f; + cfs_thread_t f; void *arg; }; static void *cfs_thread_helper(void *data) @@ -208,7 +208,7 @@ static void *cfs_thread_helper(void *data) void *arg = targ->arg; free(targ); - + (void)f(arg); return NULL; } @@ -221,11 +221,11 @@ int cfs_create_thread(cfs_thread_t func, void *arg) if ( targ_p == NULL ) return -ENOMEM; - + targ_p->f = func; targ_p->arg = arg; - pthread_attr_init(&tattr); + pthread_attr_init(&tattr); pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); rc = pthread_create(&tid, &tattr, cfs_thread_helper, targ_p); pthread_attr_destroy(&tattr); @@ -289,7 +289,7 @@ cfs_sigset_t cfs_block_sigs(cfs_sigset_t blocks) { cfs_sigset_t old; int rc; - + rc = sigprocmask(SIG_SETMASK, &blocks, &old); LASSERT (rc == 0); diff --git a/libcfs/libcfs/winnt/winnt-prim.c b/libcfs/libcfs/winnt/winnt-prim.c index e271e18e8ac0c7064c04a6eecf86d9b83122dc5a..8a2ee11b768ddc90ca943c06e1eb1c8da64c0857 100644 --- a/libcfs/libcfs/winnt/winnt-prim.c +++ b/libcfs/libcfs/winnt/winnt-prim.c @@ -54,7 +54,7 @@ * Return Value: * void: N/A * - * Notes: + * Notes: * N/A */ @@ -63,7 +63,7 @@ cfs_thread_proc( void * context ) { - cfs_thread_context_t * thread_context = + cfs_thread_context_t * thread_context = (cfs_thread_context_t *) context; /* Execute the specified function ... */ @@ -73,7 +73,7 @@ cfs_thread_proc( } /* Free the context memory */ - + cfs_free(context); /* Terminate this system thread */ @@ -93,7 +93,7 @@ cfs_thread_proc( * Return Value: * int: 0 on success or error codes * - * Notes: + * Notes: * N/A */ @@ -164,7 +164,7 @@ int libcfs_is_mp_system = FALSE; * If the symbol is in the table, return the address of it. * If not, return NULL. * - * Notes: + * Notes: * N/A */ @@ -180,11 +180,11 @@ cfs_symbol_get(const char *name) if (!strcmp(sym->name, name)) { sym->ref ++; break; - } - } + } + } up_read(&cfs_symbol_lock); - if (sym != NULL) + if (sym != NULL) return sym->value; return NULL; @@ -200,7 +200,7 @@ cfs_symbol_get(const char *name) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -217,8 +217,8 @@ cfs_symbol_put(const char *name) LASSERT(sym->ref > 0); sym->ref--; break; - } - } + } + } up_read(&cfs_symbol_lock); LASSERT(sym != NULL); @@ -236,7 +236,7 @@ cfs_symbol_put(const char *name) * Return Value: * N/A * - * Notes: + * Notes: * Zero: Succeed to register * Non-Zero: Fail to register the symbol */ @@ -282,7 +282,7 @@ cfs_symbol_register(const char *name, const void *value) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -316,7 +316,7 @@ cfs_symbol_unregister(const char *name) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -345,7 +345,7 @@ cfs_symbol_clean() /* Timer dpc procedure */ - + static void cfs_timer_dpc_proc ( IN PKDPC Dpc, @@ -384,7 +384,7 @@ void cfs_init_timer(cfs_timer_t *timer) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -412,7 +412,7 @@ void cfs_timer_init(cfs_timer_t *timer, void (*func)(ulong_ptr_t), void *arg) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -432,7 +432,7 @@ void cfs_timer_done(cfs_timer_t *timer) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -466,7 +466,7 @@ void cfs_timer_arm(cfs_timer_t *timer, cfs_time_t deadline) * Return Value: * N/A * - * Notes: + * Notes: * N/A */ @@ -492,7 +492,7 @@ void cfs_timer_disarm(cfs_timer_t *timer) * 1: if it's armed. * 0: if it's not. * - * Notes: + * Notes: * N/A */ @@ -520,7 +520,7 @@ int cfs_timer_is_armed(cfs_timer_t *timer) * Return Value: * the deadline value * - * Notes: + * Notes: * N/A */ @@ -576,9 +576,18 @@ void cfs_clear_sigpending(void) return; } +int cfs_need_resched(void) +{ + return 0; +} + +void cfs_cond_resched(void) +{ +} + /* * thread cpu affinity routines - */ + */ typedef struct _THREAD_BASIC_INFORMATION { NTSTATUS ExitStatus; @@ -751,14 +760,14 @@ void cfs_cond_resched(void) } /** - ** Initialize routines + ** Initialize routines **/ void cfs_libc_init(); int libcfs_arch_init(void) -{ +{ int rc; spinlock_t lock; @@ -785,7 +794,7 @@ libcfs_arch_init(void) cfs_page_p_slab == NULL ){ rc = -ENOMEM; goto errorout; - } + } rc = init_task_manager(); if (rc != 0) { @@ -854,7 +863,7 @@ libcfs_arch_cleanup(void) cfs_mem_cache_destroy(cfs_page_p_slab); } - return; + return; } EXPORT_SYMBOL(libcfs_arch_init);