Whamcloud - gitweb
LU-5577 libcfs: fix warnings in libcfs/curproc.h
[fs/lustre-release.git] / libcfs / include / libcfs / user-prim.h
index f8fff19..9ec0e77 100644 (file)
 # define EXPORT_SYMBOL(s)
 #endif
 
-#ifndef __KERNEL__
-
-typedef struct proc_dir_entry           cfs_proc_dir_entry_t;
-
 /*
  * Just present a single processor until will add thread support.
  */
@@ -71,17 +67,30 @@ typedef struct proc_dir_entry           cfs_proc_dir_entry_t;
 #ifndef num_possible_cpus
 # define num_possible_cpus() 1
 #endif
+#ifndef get_cpu
+# define get_cpu() 0
+#endif
+#ifndef put_cpu
+# define put_cpu() do {} while (0)
+#endif
+#ifndef NR_CPUS
+# define NR_CPUS 1
+#endif
+#ifndef for_each_possible_cpu
+# define for_each_possible_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++)
+#endif
+
 /*
  * Wait Queue.
  */
 
 typedef struct cfs_waitlink {
-        cfs_list_t sleeping;
-        void *process;
+       struct list_head sleeping;
+       void *process;
 } wait_queue_t;
 
 typedef struct cfs_waitq {
-        cfs_list_t sleepers;
+       struct list_head sleepers;
 } wait_queue_head_t;
 
 #define CFS_DECL_WAITQ(wq) wait_queue_head_t wq
@@ -111,35 +120,37 @@ void cond_resched(void);
 
 static inline void schedule(void)                      {}
 static inline void schedule_timeout(int64_t t) {}
+static inline void set_current_state(int state)
+{
+}
 
 /*
  * Lproc
  */
-typedef int (cfs_read_proc_t)(char *page, char **start, off_t off,
-                          int count, int *eof, void *data);
+typedef int (read_proc_t)(char *page, char **start, off_t off,
+                               int count, int *eof, void *data);
 
 struct file; /* forward ref */
-typedef int (cfs_write_proc_t)(struct file *file, const char *buffer,
+typedef int (write_proc_t)(struct file *file, const char *buffer,
                                unsigned long count, void *data);
 
 /*
  * Signal
  */
-typedef sigset_t                        cfs_sigset_t;
 
 /*
  * Timer
  */
 
-typedef struct {
-        cfs_list_t tl_list;
-        void (*function)(ulong_ptr_t unused);
-        ulong_ptr_t data;
-        long expires;
-} cfs_timer_t;
+struct timer_list {
+       struct list_head tl_list;
+       void (*function)(ulong_ptr_t unused);
+       ulong_ptr_t data;
+       long expires;
+};
 
 
-#define cfs_in_interrupt()    (0)
+#define in_interrupt()    (0)
 
 struct miscdevice{
 };
@@ -154,12 +165,9 @@ static inline int misc_deregister(struct miscdevice *foo)
        return 0;
 }
 
-#define cfs_sigfillset(l)               do {} while (0)
 #define cfs_recalc_sigpending(l)        do {} while (0)
-/* Fine, crash, but stop giving me compile warnings */
-#define cfs_kthread_run(fn,d,fmt,...)   LBUG()
 
-#define CFS_DAEMON_FLAGS                0
+#define DAEMON_FLAGS                0
 
 #define L1_CACHE_ALIGN(x)              (x)
 
@@ -215,9 +223,7 @@ struct cfs_stack_trace {
 /*
  * Groups
  */
-typedef struct cfs_group_info {
-
-} cfs_group_info_t;
+struct group_info{ };
 
 #ifndef min
 # define min(x,y) ((x)<(y) ? (x) : (y))
@@ -227,46 +233,13 @@ typedef struct cfs_group_info {
 # define max(x,y) ((x)>(y) ? (x) : (y))
 #endif
 
-#define cfs_get_random_bytes_prim(val, size)     (*val) = 0
+#define get_random_bytes(val, size)     (*val) = 0
 
 /* utility libcfs init/fini entries */
-#ifdef __WINNT__
-extern int libcfs_arch_init(void);
-extern void libcfs_arch_cleanup(void);
-#else /* !__WINNT__ */
 static inline int libcfs_arch_init(void) {
         return 0;
 }
 static inline void libcfs_arch_cleanup(void) {
 }
-/* __WINNT__ */
-#endif
-
-/* proc interface wrappers for non-win OS */
-#ifndef __WINNT__
-#define cfs_proc_open   open
-#define cfs_proc_mknod  mknod
-#define cfs_proc_ioctl  ioctl
-#define cfs_proc_close  close
-#define cfs_proc_read   read
-#define cfs_proc_write  write
-#define cfs_proc_fopen  fopen
-#define cfs_proc_fclose fclose
-#define cfs_proc_fgets  fgets
-/* !__WINNT__ */
-#endif
 
-/* !__KERNEL__ */
-#endif
-
-/* __LIBCFS_USER_PRIM_H__ */
-#endif
-/*
- * Local variables:
- * c-indentation-style: "K&R"
- * c-basic-offset: 8
- * tab-width: 8
- * fill-column: 80
- * scroll-step: 1
- * End:
- */
+#endif /* __LIBCFS_USER_PRIM_H__ */