Whamcloud - gitweb
LU-1346 libcfs: cleanup libcfs primitive (linux-prim.h)
[fs/lustre-release.git] / libcfs / include / libcfs / darwin / darwin-prim.h
index d3c5410..8385acc 100644 (file)
@@ -156,25 +156,25 @@ extern void             *get_bsdtask_info(task_t);
 
 #ifdef __DARWIN8__
 
-typedef struct {}              cfs_task_t;
-#define cfs_current()          ((cfs_task_t *)current_thread())
+typedef struct task_struct {};
+#define current                ((struct task_struct *)current_thread())
 #else  /* !__DARWIN8__ */
 
-typedef struct uthread         cfs_task_t;
+#define task_struct uthread
 
 #define current_uthread()       ((struct uthread *)get_bsdthread_info(current_act()))
-#define cfs_current()          current_uthread()
+#define current                current_uthread()
 
 #endif /* !__DARWIN8__ */
 
-#define cfs_task_lock(t)       do {;} while (0)
-#define cfs_task_unlock(t)     do {;} while (0)
+#define task_lock(t)   do {;} while (0)
+#define task_unlock(t) do {;} while (0)
 
 #define set_current_state(s)   do {;} while (0)
 
-#define CFS_DECL_JOURNAL_DATA  
-#define CFS_PUSH_JOURNAL       do {;} while(0)
-#define CFS_POP_JOURNAL                do {;} while(0)
+#define DECL_JOURNAL_DATA
+#define PUSH_JOURNAL   do {;} while(0)
+#define POP_JOURNAL            do {;} while(0)
 
 /*
  * Kernel thread:
@@ -204,7 +204,7 @@ extern task_t       kernel_task;
 
 #define CLONE_SIGNAL    (CLONE_SIGHAND | CLONE_THREAD)
 
-extern cfs_task_t kthread_run(cfs_thread_t func, void *arg,
+extern struct task_struct kthread_run(cfs_thread_t func, void *arg,
                              const char namefmt[], ...);
 
 /*
@@ -365,23 +365,22 @@ static inline void sleep_on(wait_queue_head_t *waitq)
 /*
  * Signal
  */
-typedef sigset_t       cfs_sigset_t;
 
 /*
  * Timer
  */
-typedef struct cfs_timer {
+struct timer_list {
        struct ktimer t;
-} cfs_timer_t;
+};
 
 #define cfs_init_timer(t)      do {} while(0)
-void cfs_timer_init(struct cfs_timer *t, void (*func)(unsigned long), void *arg);
-void cfs_timer_done(struct cfs_timer *t);
-void cfs_timer_arm(struct cfs_timer *t, cfs_time_t deadline);
-void cfs_timer_disarm(struct cfs_timer *t);
-int  cfs_timer_is_armed(struct cfs_timer *t);
+void cfs_timer_init(struct timer_list *t, void (*func)(unsigned long), void *arg);
+void cfs_timer_done(struct timer_list *t);
+void cfs_timer_arm(struct timer_list *t, cfs_time_t deadline);
+void cfs_timer_disarm(struct timer_list *t);
+int  cfs_timer_is_armed(struct timer_list *t);
 
-cfs_time_t cfs_timer_deadline(struct cfs_timer *t);
+cfs_time_t cfs_timer_deadline(struct timer_list *t);
 
 /*
  * Ioctl