coda-xfs-header-defines-fun-20050706
[openafs.git] / src / afs / sysincludes.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifdef UKERNEL
11 #include <UKERNEL/sysincludes.h>
12 #else
13
14 #ifndef __AFS_SYSINCLUDESH__
15 #define __AFS_SYSINCLUDESH__ 1
16
17 #ifdef AFS_OBSD_ENV
18 #include <sys/errno.h>
19 #include <sys/types.h>
20 #include <sys/param.h>
21 #include <sys/lock.h>
22 #include <sys/queue.h>
23 #include <sys/resourcevar.h>
24 #include <sys/kernel.h>
25 #include <sys/proc.h>
26 #include <sys/time.h>
27 #include <sys/filedesc.h>
28 #include <sys/file.h>
29 #include <sys/socket.h>
30 #include <sys/socketvar.h>
31 #include <sys/dirent.h>
32 #include <sys/user.h>
33 #include <sys/uio.h>
34 #include <sys/buf.h>
35 #include <sys/stat.h>
36 #include <sys/mount.h>
37 #include <sys/vnode.h>
38 #include <sys/malloc.h>
39 #include <ufs/ffs/fs.h>
40 #include <ufs/ufs/quota.h>
41 #include <ufs/ufs/inode.h>
42 #include <ufs/ufs/extattr.h>
43 #include <ufs/ufs/ufsmount.h>
44 #ifndef MLEN
45 #include <sys/mbuf.h>
46 #include <net/if.h>
47 #endif
48 #include <sys/protosw.h>
49 #include <sys/ioctl.h>
50 #include <sys/timeout.h>
51 #else /* AFS_OBSD_ENV */
52 #ifdef AFS_LINUX22_ENV
53 #include <linux/version.h>
54 #include <linux/config.h>
55 #include <linux/linkage.h>
56 #include <linux/limits.h>
57 #include <linux/wait.h>
58 #include <linux/types.h>
59 #include <linux/vfs.h>
60 #include <linux/net.h>
61 #include <linux/kdev_t.h>
62 #include <linux/ioctl.h>
63 #if defined(AFS_LINUX26_ENV)
64 #include <linux/backing-dev.h>
65 #include <linux/pagemap.h>
66 #include <linux/namei.h>
67 #ifdef STRUCT_INODE_HAS_I_SECURITY
68 #include <linux/security.h>
69 #endif
70 #include <linux/suspend.h>
71 #endif
72 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
73  * inclusion of uaccess.h.
74  */
75 #ifndef _LINUX_CODA_FS_I
76 #define _LINUX_CODA_FS_I
77 #define _CODA_HEADER_
78 #define _CFS_HEADER_
79 struct coda_inode_info {
80 };
81 #endif
82 #ifndef _LINUX_XFS_FS_I
83 #define _LINUX_XFS_FS_I
84 struct xfs_inode_info {
85 };
86 #endif
87 #include <asm/uaccess.h>
88 #include <linux/list.h>
89 #include <linux/dcache.h>
90 #include <linux/mount.h>
91 #include <linux/fs.h>
92 #include <linux/quota.h>
93 #include <linux/sched.h>
94 #include <linux/mm.h>
95 #include <linux/slab.h>
96 #include <linux/string.h>
97 #include <asm/semaphore.h>
98 #include <linux/errno.h>
99 #ifdef COMPLETION_H_EXISTS
100 #include <linux/completion.h>
101 #endif
102
103 #else /* AFS_LINUX22_ENV */
104 #if defined(AFS_DARWIN_ENV)
105 #ifndef _MACH_ETAP_H_
106 #define _MACH_ETAP_H_
107 typedef unsigned short etap_event_t;
108 #endif
109 #endif
110 #if     !defined(AFS_OSF_ENV)
111 #include "h/errno.h"
112 #include "h/types.h"
113 #include "h/param.h"
114
115 #ifdef  AFS_AUX_ENV
116 #ifdef  PAGING
117 #include "h/mmu.h"
118 #include "h/seg.h"
119 #include "h/page.h"
120 #include "h/region.h"
121 #endif /* PAGING */
122 #include "h/sysmacros.h"
123 #include "h/signal.h"
124 #include "h/var.h"
125 #endif /* AFS_AUX_ENV */
126
127 #include "h/systm.h"
128 #include "h/time.h"
129
130 #ifdef  AFS_AIX_ENV
131 #ifdef AFS_AIX41_ENV
132 #include "sys/statfs.h"
133 #endif
134 #ifdef AFS_AIX51_ENV
135 #include "sys/acl.h"
136 #endif
137 #include "../h/file.h"
138 #include "../h/fullstat.h"
139 #include "../h/vattr.h"
140 #include "../h/var.h"
141 #include "../h/access.h"
142 #endif /* AFS_AIX_ENV */
143
144 #if defined(AFS_SGI_ENV)
145 #include "values.h"
146 #include "sys/sema.h"
147 #include "sys/cmn_err.h"
148 #ifdef AFS_SGI64_ENV
149 #include <ksys/behavior.h>
150 /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
151  * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
152  * older headers like we want the old behavior, so we fake it. */
153 #if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
154 #define BHV_IS_BHVL(bhp) (0)
155 #endif
156 #endif /* AFS_SGI64_ENV */
157 #include "fs/efs_inode.h"
158 #ifdef AFS_SGI_EFS_IOPS_ENV
159 #include "sgiefs/efs.h"
160 #endif
161 #include "sys/kmem.h"
162 #include "sys/cred.h"
163 #include "sys/resource.h"
164
165 /*
166  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
167  * is on (see afs_osi.h).
168  * In IRIX 6.5 we cannot have DEBUG turned on since certain
169  * system-defined structures have different members with DEBUG on, and
170  * this breaks our ability to interact with the rest of the kernel.
171  *
172  * Instead of using ASSERT(), we use our own osi_Assert().
173  */
174 #if defined(AFS_SGI65_ENV) && !defined(DEBUG)
175 #define DEBUG
176 #include "sys/debug.h"
177 #undef DEBUG
178 #else
179 #include "sys/debug.h"
180 #endif
181
182 #include "sys/statvfs.h"
183 #include "sys/sysmacros.h"
184 #include "sys/fs_subr.h"
185 #include "sys/siginfo.h"
186 #endif /* AFS_SGI_ENV */
187
188 #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
189 #  include "h/kernel.h"
190 #endif /* !SUN5 && !SGI */
191
192 #ifdef  AFS_SUN5_ENV
193 #include <sys/cmn_err.h>        /* for kernel printf() prototype */
194 #endif
195
196 #if     defined(AFS_SUN56_ENV)
197 #include "h/vfs.h"              /* stops SUN56 socketvar.h warnings */
198 #include "h/stropts.h"          /* stops SUN56 socketvar.h warnings */
199 #include "h/stream.h"           /* stops SUN56 socketvar.h errors */
200 #endif
201
202 #ifdef AFS_SUN510_ENV
203 #include <sys/cred_impl.h>
204 #endif
205
206 #include "h/socket.h"
207 #include "h/socketvar.h"
208 #include "h/protosw.h"
209
210 #if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
211 #  include "h/dirent.h"
212 #  ifdef        AFS_SUN5_ENV
213 #    include "h/sysmacros.h"
214 #    include "h/fs/ufs_fsdir.h"
215 #  endif /* AFS_SUN5_ENV */
216 #else
217 #  include "h/dir.h"
218 #endif /* SGI || SUN || HPUX */
219
220 #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
221 #include "h/user.h"
222 #endif /* AFS_SGI64_ENV */
223 #define MACH_USER_API   1
224 #if defined(AFS_FBSD50_ENV)
225 #include "h/bio.h"
226 #include "h/filedesc.h"
227 #endif
228 #include "h/file.h"
229 #include "h/uio.h"
230 #include "h/buf.h"
231 #include "h/stat.h"
232
233
234 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
235 #  ifdef        AFS_SUN5_ENV
236 #    include "h/statvfs.h"
237 #  endif /* AFS_SUN5_ENV */
238 #  ifdef AFS_HPUX_ENV
239 struct vfspage;                 /* for vnode.h compiler warnings */
240 #    include "h/swap.h"         /* for struct swpdbd, for vnode.h compiler warnings */
241 #    include "h/dbd.h"          /* for union idbd, for vnode.h compiler warnings */
242 #ifdef AFS_HPUX110_ENV
243 #    include "h/resource.h"
244 #endif
245 #ifdef AFS_HPUX1123_ENV 
246 #       include <sys/user.h>
247 #       include <sys/cred.h>
248 #endif
249 #  endif /* AFS_HPUX_ENV */
250 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
251 #  if defined(AFS_FBSD50_ENV)
252 struct vop_getwritemount_args;
253 #  endif
254 #  include <sys/uio.h>
255 #  include <sys/mount.h>
256 #  include <sys/namei.h>
257 #  include <sys/vnode.h>
258 #  include <sys/queue.h>
259 #  include <sys/malloc.h>
260 #ifndef AFS_FBSD_ENV
261 #  include <sys/ubc.h>
262 #define timeout_fcn_t mach_timeout_fcn_t
263 #  include <kern/sched_prim.h>
264 #else
265 MALLOC_DECLARE(M_AFS);
266 #  include <ufs/ufs/dinode.h>
267 #  include <vm/vm.h>
268 #  include <vm/vm_extern.h>
269 #  include <vm/pmap.h>
270 #  include <vm/vm_map.h>
271 #  include <sys/lock.h>
272 #  include <sys/user.h>
273 #endif
274 #undef timeout_fcn_t
275 #define _DIR_H_
276 #define doff_t          int32_t
277 #  include <ufs/ufs/quota.h>
278 #  include <ufs/ufs/inode.h>
279 #  include <ufs/ffs/fs.h>
280 #else
281 #  include "h/vfs.h"
282 #  include "h/vnode.h"
283 #  ifdef        AFS_SUN5_ENV
284 #    include "h/fs/ufs_inode.h"
285 #    include "h/fs/ufs_mount.h"
286 #  else
287 #    if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
288 #      include "ufs/inode.h"
289 #      if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
290 #        include "ufs/mount.h"
291 #      endif /* !AFS_HPUX_ENV */
292 #    endif /* !AFS_AIX32_ENV */
293 #  endif /* AFS_SUN5_ENV */
294 #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
295
296 /* These mainly deal with networking and rpc headers */
297 #include "netinet/in.h"
298 #undef  MFREE                   /* defined at mount.h for AIX */
299 #ifdef  AFS_SUN5_ENV
300 #  include "h/time.h"
301 #else
302 #if !defined(AFS_HPUX_ENV)
303 #  include "h/mbuf.h"
304 #endif
305 #endif /* AFS_SUN5_ENV */
306
307 #include "rpc/types.h"
308 #include "rx/xdr.h"
309
310 /* Miscellaneous headers */
311 #include "h/proc.h"
312 #if !defined(AFS_FBSD_ENV)
313 #include "h/ioctl.h"
314 #endif /* AFS_FBSD_ENV */
315
316 #if     defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
317 #include "h/proc_iface.h"
318 #include "h/vas.h"
319 #endif
320
321 #if     defined(AFS_HPUX102_ENV)
322 #include "h/unistd.h"
323 #include "h/tty.h"
324 #endif
325
326 #if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
327
328 #  include "h/text.h"
329 #endif
330
331
332 #if     defined(AFS_AIX_ENV) 
333 #  include "h/flock.h"          /* fcntl.h is a user-level include in aix */
334 #else
335 #  include "h/fcntl.h"
336 #endif /* AIX */
337
338 #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
339 #  include "h/unistd.h"
340 #endif /* SGI || SUN */
341
342 #ifdef  AFS_AIX32_ENV
343 #  include "h/vmuser.h"
344 #endif /* AFS_AIX32_ENV */
345
346 #if     defined(AFS_SUN5_ENV)
347 #include <sys/tiuser.h>
348 #include <sys/t_lock.h>
349 #include <sys/mutex.h>
350 #include <sys/vtrace.h>
351 #include <sys/pathname.h>
352 #include <sys/debug.h>
353 #endif
354
355 #else /* ! AFS_OSF_ENV */
356 /* All of the OSF/1 stuff is here */
357 #include <net/net_globals.h>
358 #include <errno.h>
359 #include <sys/types.h>
360 #include <sys/param.h>
361 #include <sys/systm.h>
362 #include <sys/time.h>
363 #include <sys/kernel.h>
364 #include <sys/socket.h>
365 #include <sys/socketvar.h>
366 #include <sys/protosw.h>
367 #include <ufs/dir.h>
368 #include <sys/user.h>
369 #include <sys/file.h>
370 #include <sys/uio.h>
371 #include <sys/buf.h>
372 #include <sys/stat.h>
373 #include <sys/vnode.h>
374 #include <ufs/inode.h>
375 #include <sys/mount.h>
376 #include <vm/vm_page.h>
377 #include <mach/vm_param.h>
378 #include <kern/parallel.h>
379 #include <mach/mach_types.h>
380 #ifndef AFS_OSF30_ENV
381 #include <kern/mfs.h>
382 #endif
383 #include <mach/vm_param.h>
384 #include <kern/parallel.h>
385
386 /* These mainly deal with networking and rpc headers */
387 #include <netinet/in.h>
388 #include <sys/mbuf.h>
389 #include <rpc/types.h>
390
391 #ifdef  AFS_OSF_ENV
392 #undef kmem_alloc
393 #undef kmem_free
394 #undef mem_alloc
395 #undef mem_free
396 #undef register
397 #endif /* AFS_OSF_ENV */
398
399 #include <rx/xdr.h>
400 #include <sys/proc.h>
401 #include <sys/ioctl.h>
402
403 #endif /* AFS_OSF_ENV */
404 #endif /* AFS_LINUX22_ENV */
405 #endif /* AFS_OBSD_ENV */
406
407 #endif /* __AFS_SYSINCLUDESH__  so idempotent */
408
409 #endif