Whamcloud - gitweb
merge with HEAD.
authornikita <nikita>
Sun, 19 Oct 2008 10:10:49 +0000 (10:10 +0000)
committernikita <nikita>
Sun, 19 Oct 2008 10:10:49 +0000 (10:10 +0000)
libcfs/include/libcfs/posix/libcfs.h
libcfs/libcfs/linux/linux-prim.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/user-lock.c
libcfs/libcfs/user-prim.c
libcfs/libcfs/winnt/winnt-prim.c

index 95035d2..909deef 100644 (file)
@@ -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;
 }
 
index 9019b3f..18f81b4 100644 (file)
@@ -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);
index de9c8e9..6913c44 100644 (file)
@@ -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);
index cee36d7..d36a17b 100644 (file)
@@ -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;
index bf57b4c..4c52964 100644 (file)
@@ -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);
 
index e271e18..8a2ee11 100644 (file)
@@ -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);