Whamcloud - gitweb
land lustre part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lustre / include / liblustre.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001 Cluster File Systems, Inc. <info@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * User-space Lustre headers.
22  *
23  */
24 #ifndef LIBLUSTRE_H__
25 #define LIBLUSTRE_H__
26
27 #include <sys/mman.h>
28 #ifndef  __CYGWIN__
29 #include <stdint.h>
30 #include <asm/page.h>
31 #else
32 #include <sys/types.h>
33 #include "ioctl.h"
34 #endif
35 #include <stdio.h>
36 #include <sys/ioctl.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <errno.h>
40 #include <sys/stat.h>
41 #include <sys/vfs.h>
42
43 #include <libcfs/list.h>
44 #include <portals/p30.h>
45 #include <libcfs/kp30.h>
46
47 /* definitions for liblustre */
48
49 #ifdef __CYGWIN__
50
51 #define PAGE_SHIFT 12
52 #define PAGE_SIZE (1UL << PAGE_SHIFT)
53 #define PAGE_MASK (~(PAGE_SIZE-1))
54 #define loff_t long long
55 #define ERESTART 2001
56 typedef unsigned short umode_t;
57
58 #endif
59
60 /* This is because lprocfs_status.h gets included here indirectly.  It would
61  * be much better to just avoid lprocfs being included into liblustre entirely
62  * but that requires more header surgery than I can handle right now.
63  */
64 #ifndef smp_processor_id
65 #define smp_processor_id() 0
66 #endif
67
68 /* always adopt 2.5 definitions */
69 #define KERNEL_VERSION(a,b,c) ((a)*100+(b)*10+c)
70 #define LINUX_VERSION_CODE (2*200+5*10+0)
71
72 static inline void inter_module_put(void *a)
73 {
74         return;
75 }
76
77 extern ptl_handle_ni_t         tcpnal_ni;
78
79 void *inter_module_get(char *arg);
80
81 /* cheats for now */
82
83 struct work_struct {
84         void (*ws_task)(void *arg);
85         void *ws_arg;
86 };
87
88 static inline void prepare_work(struct work_struct *q, void (*t)(void *),
89                                 void *arg)
90 {
91         q->ws_task = t;
92         q->ws_arg = arg;
93         return;
94 }
95
96 static inline void schedule_work(struct work_struct *q)
97 {
98         q->ws_task(q->ws_arg);
99 }
100
101
102 #define strnlen(a,b) strlen(a)
103 static inline void *kmalloc(int size, int prot)
104 {
105         return malloc(size);
106 }
107 #define vmalloc malloc
108 #define vfree free
109 #define kfree(a) free(a)
110 #define GFP_KERNEL 1
111 #define GFP_HIGHUSER 1
112 #define GFP_ATOMIC 1
113 #define GFP_NOFS 1
114 #define IS_ERR(a) (((a) && abs((long)(a)) < 500) ? 1 : 0)
115 #define PTR_ERR(a) ((long)(a))
116 #define ERR_PTR(a) ((void*)((long)(a)))
117
118 typedef struct {
119         void *cwd;
120 }mm_segment_t;
121
122 typedef int (read_proc_t)(char *page, char **start, off_t off,
123                           int count, int *eof, void *data);
124
125 struct file; /* forward ref */
126 typedef int (write_proc_t)(struct file *file, const char *buffer,
127                            unsigned long count, void *data);
128
129 #define NIPQUAD(addr) \
130         ((unsigned char *)&addr)[0], \
131         ((unsigned char *)&addr)[1], \
132         ((unsigned char *)&addr)[2], \
133         ((unsigned char *)&addr)[3]
134
135 #if defined(__LITTLE_ENDIAN)
136 #define HIPQUAD(addr) \
137         ((unsigned char *)&addr)[3], \
138         ((unsigned char *)&addr)[2], \
139         ((unsigned char *)&addr)[1], \
140         ((unsigned char *)&addr)[0]
141 #elif defined(__BIG_ENDIAN)
142 #define HIPQUAD NIPQUAD
143 #else
144 #error "Undefined byteorder??"
145 #endif /* __LITTLE_ENDIAN */
146
147 /* bits ops */
148 static __inline__ int set_bit(int nr,long * addr)
149 {
150         int     mask, retval;
151
152         addr += nr >> 5;
153         mask = 1 << (nr & 0x1f);
154         retval = (mask & *addr) != 0;
155         *addr |= mask;
156         return retval;
157 }
158
159 static __inline__ int clear_bit(int nr, long * addr)
160 {
161         int     mask, retval;
162
163         addr += nr >> 5;
164         mask = 1 << (nr & 0x1f);
165         retval = (mask & *addr) != 0;
166         *addr &= ~mask;
167         return retval;
168 }
169
170 static __inline__ int test_bit(int nr, long * addr)
171 {
172         int     mask;
173
174         addr += nr >> 5;
175         mask = 1 << (nr & 0x1f);
176         return ((mask & *addr) != 0);
177 }
178
179 static __inline__ int ext2_set_bit(int nr, void *addr)
180 {
181         return set_bit(nr, (long*)addr);
182 }
183
184 static __inline__ int ext2_clear_bit(int nr, void *addr)
185 {
186         return clear_bit(nr, (long*)addr);
187 }
188
189 static __inline__ int ext2_test_bit(int nr, void *addr)
190 {
191         return test_bit(nr, (long*)addr);
192 }
193
194 /* modules */
195
196 struct module {
197         int count;
198 };
199
200 #define MODULE_AUTHOR(name)
201 #define MODULE_DESCRIPTION(name)
202 #define MODULE_LICENSE(name)
203
204 #define module_init(init)
205 #define module_exit(exit)
206
207 #define THIS_MODULE NULL
208 #define __init
209 #define __exit
210 #define __user
211
212 /* devices */
213
214 static inline int misc_register(void *foo)
215 {
216         return 0;
217 }
218
219 static inline int misc_deregister(void *foo)
220 {
221         return 0;
222 }
223
224 static inline int request_module(char *name)
225 {
226         return (-EINVAL);
227 }
228
229 #define __MOD_INC_USE_COUNT(m)  do {} while (0)
230 #define __MOD_DEC_USE_COUNT(m)  do {} while (0)
231 #define MOD_INC_USE_COUNT       do {} while (0)
232 #define MOD_DEC_USE_COUNT       do {} while (0)
233 static inline void __module_get(struct module *module)
234 {
235 }
236
237 static inline int try_module_get(struct module *module)
238 {
239         return 1;
240 }
241
242 static inline void module_put(struct module *module)
243 {
244 }
245
246 /* module initialization */
247 extern int init_obdclass(void);
248 extern int ptlrpc_init(void);
249 extern int ldlm_init(void);
250 extern int osc_init(void);
251 extern int lov_init(void);
252 extern int mdc_init(void);
253 extern int echo_client_init(void);
254
255
256
257 /* general stuff */
258
259 #define EXPORT_SYMBOL(S)
260
261 typedef struct { } spinlock_t;
262 typedef __u64 kdev_t;
263
264 #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
265 #define LASSERT_SPIN_LOCKED(lock) do {} while(0)
266
267 static inline void spin_lock(spinlock_t *l) {return;}
268 static inline void spin_unlock(spinlock_t *l) {return;}
269 static inline void spin_lock_init(spinlock_t *l) {return;}
270 static inline void local_irq_save(unsigned long flag) {return;}
271 static inline void local_irq_restore(unsigned long flag) {return;}
272 static inline int spin_is_locked(spinlock_t *l) {return 1;}
273
274 static inline void spin_lock_bh(spinlock_t *l) {}
275 static inline void spin_unlock_bh(spinlock_t *l) {}
276 static inline void spin_lock_irqsave(spinlock_t *a, unsigned long b) {}
277 static inline void spin_unlock_irqrestore(spinlock_t *a, unsigned long b) {}
278
279 typedef struct { } rwlock_t;
280 #define rwlock_init(x) do {} while(0)
281 #define RW_LOCK_UNLOCKED (rwlock_t) {}
282 #define read_lock(l)
283 #define read_unlock(l)
284 #define write_lock(l)
285 #define write_unlock(l)
286
287 #define min(x,y) ((x)<(y) ? (x) : (y))
288 #define max(x,y) ((x)>(y) ? (x) : (y))
289
290 #ifndef min_t
291 #define min_t(type,x,y) \
292         ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
293 #endif
294 #ifndef max_t
295 #define max_t(type,x,y) \
296         ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
297 #endif
298
299 #define container_of(ptr, type, member) ({                      \
300         const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
301         (type *)( (char *)__mptr - offsetof(type,member) );})
302
303 /* registering symbols */
304
305 #define ERESTARTSYS ERESTART
306 #define HZ 1
307
308 /* random */
309
310 void get_random_bytes(void *ptr, int size);
311
312 /* memory */
313
314 /* FIXME */
315 #define num_physpages (16 * 1024)
316
317 static inline int copy_from_user(void *a,void *b, int c)
318 {
319         memcpy(a,b,c);
320         return 0;
321 }
322
323 static inline int copy_to_user(void *a,void *b, int c)
324 {
325         memcpy(a,b,c);
326         return 0;
327 }
328
329 static inline long strncpy_from_user(char *dest, const char *src, long n)
330 {
331         char *s;
332         s = strncpy(dest, src, n);
333         return strnlen(s, n);
334 }
335
336 /* slabs */
337 typedef struct {
338          int size;
339 } kmem_cache_t;
340 #define SLAB_HWCACHE_ALIGN 0
341 static inline kmem_cache_t *
342 kmem_cache_create(const char *name, size_t objsize, size_t cdum,
343                   unsigned long d,
344                   void (*e)(void *, kmem_cache_t *, unsigned long),
345                   void (*f)(void *, kmem_cache_t *, unsigned long))
346 {
347         kmem_cache_t *c;
348         c = malloc(sizeof(*c));
349         if (!c)
350                 return NULL;
351         c->size = objsize;
352         CDEBUG(D_MALLOC, "alloc slab cache %s at %p, objsize %d\n",
353                name, c, (int)objsize);
354         return c;
355 };
356
357 static inline int kmem_cache_destroy(kmem_cache_t *a)
358 {
359         CDEBUG(D_MALLOC, "destroy slab cache %p, objsize %u\n", a, a->size);
360         free(a);
361         return 0;
362 }
363 #define kmem_cache_alloc(cache, prio) malloc(cache->size)
364 #define kmem_cache_free(cache, obj) free(obj)
365
366 #define PAGE_CACHE_SIZE  PAGE_SIZE
367 #define PAGE_CACHE_SHIFT PAGE_SHIFT
368 #define PAGE_CACHE_MASK  PAGE_MASK
369
370 /* struct page decl moved out from here into portals/include/libcfs/user-prim.h */
371
372 /* 2.4 defines */
373 #define PAGE_LIST_ENTRY list
374 #define PAGE_LIST(page) ((page)->list)
375
376 #define page_address(page) ((page)->addr)
377 #define kmap(page) (page)->addr
378 #define kunmap(a) do {} while (0)
379
380 static inline struct page *alloc_pages(int mask, unsigned long order)
381 {
382         struct page *pg = malloc(sizeof(*pg));
383
384         if (!pg)
385                 return NULL;
386 #if 0 //#ifdef MAP_ANONYMOUS
387         pg->addr = mmap(0, PAGE_SIZE << order, PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
388 #else
389         pg->addr = malloc(PAGE_SIZE << order);
390 #endif
391
392         if (!pg->addr) {
393                 free(pg);
394                 return NULL;
395         }
396         return pg;
397 }
398
399 #define alloc_page(mask) alloc_pages((mask), 0)
400
401 static inline void __free_pages(struct page *pg, int what)
402 {
403 #if 0 //#ifdef MAP_ANONYMOUS
404         munmap(pg->addr, PAGE_SIZE);
405 #else
406         free(pg->addr);
407 #endif
408         free(pg);
409 }
410
411 #define __free_page(page) __free_pages((page), 0)
412 #define free_page(page) __free_page(page)
413
414 static inline struct page* __grab_cache_page(unsigned long index)
415 {
416         struct page *pg = alloc_pages(0, 0);
417
418         if (pg)
419                 pg->index = index;
420         return pg;
421 }
422
423 #define grab_cache_page(index) __grab_cache_page(index)
424 #define page_cache_release(page) __free_pages(page, 0)
425
426 /* arithmetic */
427 #define do_div(a,b)                     \
428         ({                              \
429                 unsigned long remainder;\
430                 remainder = (a) % (b);  \
431                 (a) = (a) / (b);        \
432                 (remainder);            \
433         })
434
435 /* VFS stuff */
436 #define ATTR_MODE       0x0001
437 #define ATTR_UID        0x0002
438 #define ATTR_GID        0x0004
439 #define ATTR_SIZE       0x0008
440 #define ATTR_ATIME      0x0010
441 #define ATTR_MTIME      0x0020
442 #define ATTR_CTIME      0x0040
443 #define ATTR_ATIME_SET  0x0080
444 #define ATTR_MTIME_SET  0x0100
445 #define ATTR_FORCE      0x0200  /* Not a change, but a change it */
446 #define ATTR_ATTR_FLAG  0x0400
447 #define ATTR_RAW        0x0800  /* file system, not vfs will massage attrs */
448 #define ATTR_FROM_OPEN  0x1000  /* called from open path, ie O_TRUNC */
449 /* ATTR_CTIME_SET has been defined in lustre_idl.h */
450
451 struct iattr {
452         unsigned int    ia_valid;
453         umode_t         ia_mode;
454         uid_t           ia_uid;
455         gid_t           ia_gid;
456         loff_t          ia_size;
457         time_t          ia_atime;
458         time_t          ia_mtime;
459         time_t          ia_ctime;
460         unsigned int    ia_attr_flags;
461 };
462
463 #define IT_OPEN     0x0001
464 #define IT_CREAT    0x0002
465 #define IT_READDIR  0x0004
466 #define IT_GETATTR  0x0008
467 #define IT_LOOKUP   0x0010
468 #define IT_UNLINK   0x0020
469 #define IT_GETXATTR 0x0040
470 #define IT_EXEC     0x0080
471 #define IT_PIN      0x0100
472 #define IT_CHDIR    0x0200
473
474 #define IT_FL_LOCKED   0x0001
475 #define IT_FL_FOLLOWED 0x0002 /* set by vfs_follow_link */
476
477 #define INTENT_MAGIC 0x19620323
478
479 struct lookup_intent {
480         int     it_magic;
481         void    (*it_op_release)(struct lookup_intent *);
482         int     it_op;
483         int     it_flags;
484         int     it_create_mode;
485         union {
486                 void *fs_data; /* FS-specific intent data */
487         } d;
488 };
489
490 struct lustre_intent_data {
491         int     it_disposition;
492         int     it_status;
493         __u64   it_lock_handle;
494         void    *it_data;
495         int     it_lock_mode;
496         int     it_int_flags;
497 };
498
499 #define LUSTRE_IT(it) ((struct lustre_intent_data *)((it)->d.fs_data))
500
501 static inline void intent_init(struct lookup_intent *it, int op, int flags)
502 {
503         memset(it, 0, sizeof(*it));
504         it->it_magic = INTENT_MAGIC;
505         it->it_op = op;
506         it->it_flags = flags;
507 }
508
509
510 struct dentry {
511         int d_count;
512 };
513
514 struct vfsmount {
515         void *pwd;
516 };
517
518 /* semaphores */
519 struct rw_semaphore {
520         int count;
521 };
522
523 /* semaphores */
524 struct semaphore {
525         int count;
526 };
527
528 /* use the macro's argument to avoid unused warnings */
529 #define down(a) do { (void)a; } while (0)
530 #define up(a) do { (void)a; } while (0)
531 #define down_read(a) do { (void)a; } while (0)
532 #define up_read(a) do { (void)a; } while (0)
533 #define down_write(a) do { (void)a; } while (0)
534 #define up_write(a) do { (void)a; } while (0)
535 #define sema_init(a,b) do { (void)a; } while (0)
536 #define init_rwsem(a) do { (void)a; } while (0)
537 #define DECLARE_MUTEX(name)     \
538         struct semaphore name = { 1 }
539 static inline void init_MUTEX (struct semaphore *sem)
540 {
541         sema_init(sem, 1);
542 }
543
544
545 typedef struct  {
546         struct list_head sleepers;
547 } wait_queue_head_t;
548
549 typedef struct  {
550         struct list_head sleeping;
551         void *process;
552 } wait_queue_t;
553
554 struct signal {
555         int signal;
556 };
557
558 struct fs_struct {
559         int umask;
560 };
561
562 struct task_struct {
563         struct fs_struct *fs;
564         int state;
565         struct signal pending;
566         char comm[32];
567         int pid;
568         uid_t uid;
569         gid_t gid;
570         int fsuid;
571         int fsgid;
572         int max_groups;
573         int ngroups;
574         gid_t *groups;
575         __u32 cap_effective;
576
577         struct fs_struct __fs;
578 };
579
580 extern struct task_struct *current;
581 int in_group_p(gid_t gid);
582 static inline int capable(int cap)
583 {
584         if (current->cap_effective & (1 << cap))
585                 return 1;
586         else
587                 return 0;
588 }
589
590 #define set_current_state(foo) do { current->state = foo; } while (0)
591
592 #define init_waitqueue_entry(q,p) do { (q)->process = p; } while (0)
593 #define add_wait_queue(q,p) do {  list_add(&(q)->sleepers, &(p)->sleeping); } while (0)
594 #define del_wait_queue(p) do { list_del(&(p)->sleeping); } while (0)
595 #define remove_wait_queue(q,p) do { list_del(&(p)->sleeping); } while (0)
596
597 #define DECLARE_WAIT_QUEUE_HEAD(HEAD)                           \
598         wait_queue_head_t HEAD = {                              \
599                 .sleepers = LIST_HEAD_INIT(HEAD.sleepers)       \
600         }
601 #define init_waitqueue_head(l) INIT_LIST_HEAD(&(l)->sleepers)
602 #define wake_up(l) do { int a; a++; } while (0)
603 #define TASK_INTERRUPTIBLE 0
604 #define TASK_UNINTERRUPTIBLE 1
605 #define TASK_RUNNING 2
606
607 #define wait_event_interruptible(wq, condition)                         \
608 ({                                                                      \
609         struct l_wait_info lwi;                                         \
610         int timeout = 100000000;/* for ever */                          \
611         int ret;                                                        \
612                                                                         \
613         lwi = LWI_TIMEOUT(timeout, NULL, NULL);                         \
614         ret = l_wait_event(NULL, condition, &lwi);                      \
615                                                                         \
616         ret;                                                            \
617 })
618
619 #define in_interrupt() (0)
620
621 #define schedule() do {} while (0)
622 static inline int schedule_timeout(signed long t)
623 {
624         return 0;
625 }
626
627 #define lock_kernel() do {} while (0)
628 #define daemonize(l) do {} while (0)
629 #define sigfillset(l) do {} while (0)
630 #define recalc_sigpending(l) do {} while (0)
631 #define kernel_thread(l,m,n) LBUG()
632
633 #define USERMODEHELPER(path, argv, envp) (0)
634 #define SIGNAL_MASK_ASSERT()
635 #define KERN_INFO
636
637 #include <sys/time.h>
638 #if HZ != 1
639 #error "liblustre's jiffies currently expects HZ to be 1"
640 #endif
641 #define jiffies                                 \
642 ({                                              \
643         unsigned long _ret = 0;                 \
644         struct timeval tv;                      \
645         if (gettimeofday(&tv, NULL) == 0)       \
646                 _ret = tv.tv_sec;               \
647         _ret;                                   \
648 })
649 #define time_after(a, b) ((long)(b) - (long)(a) < 0)
650 #define time_before(a, b) time_after(b,a)
651
652 static inline unsigned long get_seconds(void)
653 {
654         struct timeval tv;
655
656         gettimeofday(&tv, NULL);
657         return (tv.tv_sec + tv.tv_usec / 1000000);
658 }
659
660 struct timer_list {
661         struct list_head tl_list;
662         void (*function)(unsigned long unused);
663         unsigned long data;
664         long expires;
665 };
666
667 static inline int timer_pending(struct timer_list *l)
668 {
669         if (l->expires > jiffies)
670                 return 1;
671         else
672                 return 0;
673 }
674
675 static inline int init_timer(struct timer_list *l)
676 {
677         INIT_LIST_HEAD(&l->tl_list);
678         return 0;
679 }
680
681 static inline void mod_timer(struct timer_list *l, int thetime)
682 {
683         l->expires = thetime;
684 }
685
686 static inline void del_timer(struct timer_list *l)
687 {
688         free(l);
689 }
690
691 typedef struct { volatile int counter; } atomic_t;
692
693 #define ATOMIC_INIT(i) { (i) }
694 #define atomic_read(a) ((a)->counter)
695 #define atomic_set(a,b) do {(a)->counter = b; } while (0)
696 #define atomic_dec_and_test(a) ((--((a)->counter)) == 0)
697 #define atomic_inc(a)  (((a)->counter)++)
698 #define atomic_dec(a)  do { (a)->counter--; } while (0)
699 #define atomic_add(b,a)  do {(a)->counter += b;} while (0)
700 #define atomic_sub(b,a)  do {(a)->counter -= b;} while (0)
701
702 #ifndef likely
703 #define likely(exp) (exp)
704 #endif
705 #ifndef unlikely
706 #define unlikely(exp) (exp)
707 #endif
708
709 /* FIXME sys/capability will finally included linux/fs.h thus
710  * cause numerous trouble on x86-64. as temporary solution for
711  * build broken at cary, we copy definition we need from capability.h
712  * FIXME
713  */
714 struct _cap_struct;
715 typedef struct _cap_struct *cap_t;
716 typedef int cap_value_t;
717 typedef enum {
718     CAP_EFFECTIVE=0,
719     CAP_PERMITTED=1,
720     CAP_INHERITABLE=2
721 } cap_flag_t;
722 typedef enum {
723     CAP_CLEAR=0,
724     CAP_SET=1
725 } cap_flag_value_t;
726
727 #define CAP_DAC_OVERRIDE        1
728 #define CAP_DAC_READ_SEARCH     2
729 #define CAP_FOWNER              3
730 #define CAP_FSETID              4
731 #define CAP_SYS_ADMIN          21
732
733 cap_t   cap_get_proc(void);
734 int     cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
735
736
737
738 /* log related */
739 static inline int llog_init_commit_master(void) { return 0; }
740 static inline int llog_cleanup_commit_master(int force) { return 0; }
741 static inline void portals_run_lbug_upcall(char *file, const char *fn,
742                                            const int l){}
743
744 #define LBUG()                                                          \
745         do {                                                            \
746                 printf("!!!LBUG at %s:%d\n", __FILE__, __LINE__);       \
747                 sleep(1000000);                                         \
748         } while (0)
749
750
751
752 /* completion */
753 struct completion {
754         unsigned int done;
755         wait_queue_head_t wait;
756 };
757
758 #define COMPLETION_INITIALIZER(work) \
759         { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
760
761 #define DECLARE_COMPLETION(work) \
762         struct completion work = COMPLETION_INITIALIZER(work)
763
764 #define INIT_COMPLETION(x)      ((x).done = 0)
765
766 static inline void init_completion(struct completion *x)
767 {
768         x->done = 0;
769         init_waitqueue_head(&x->wait);
770 }
771
772 struct liblustre_wait_callback {
773         struct list_head    llwc_list;
774         int               (*llwc_fn)(void *arg);
775         void               *llwc_arg;
776 };
777
778 void *liblustre_register_wait_callback(int (*fn)(void *arg), void *arg);
779 void liblustre_deregister_wait_callback(void *notifier);
780 int liblustre_wait_event(int timeout);
781
782 #include <linux/obd_support.h>
783 #include <linux/lustre_idl.h>
784 #include <linux/lustre_lib.h>
785 #include <linux/lustre_import.h>
786 #include <linux/lustre_export.h>
787 #include <linux/lustre_net.h>
788
789
790 #endif