5e8ae9c37132bc4c109dd156711d07bcedb2e837
[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 # ifndef AFS_OBSD38_ENV
43 #  include <ufs/ufs/extattr.h>
44 # endif
45 # include <ufs/ufs/ufsmount.h>
46 # ifndef MLEN
47 #  include <sys/mbuf.h>
48 #  include <net/if.h>
49 # endif
50 # include <sys/protosw.h>
51 # include <sys/ioctl.h>
52 # include <sys/timeout.h>
53
54 #elif defined(AFS_NBSD40_ENV)
55 # ifdef AFS_NBSD50_ENV
56 #  include <sys/simplelock.h>
57 # endif
58 # include <sys/errno.h>
59 # include <sys/types.h>
60 # include <sys/mount.h> /* may define MOUNT_AFS */
61 # include <sys/param.h>
62 # include <sys/systm.h>
63 # include <sys/conf.h>
64 # include <sys/exec.h>
65 # include <sys/lock.h>
66 # include <sys/syscall.h>
67 # include <sys/syscallargs.h>
68 # include <sys/queue.h>
69 # include <sys/resourcevar.h>
70 # include <sys/kernel.h>
71 # include <sys/proc.h>
72 # include <sys/time.h>
73 # include <sys/filedesc.h>
74 # include <sys/exec.h>
75 # include <sys/lock.h>
76 # include <sys/syscall.h>
77 # include <sys/syscallargs.h>
78 # include <sys/queue.h>
79 # include <sys/resourcevar.h>
80 # include <sys/kernel.h>
81 # include <sys/proc.h>
82 # include <sys/time.h>
83 # include <sys/filedesc.h>
84 # include <sys/file.h>
85 # include <sys/socket.h>
86 # include <sys/socketvar.h>
87 # include <sys/dirent.h>
88 # include <sys/user.h>
89 # include <sys/kauth.h>
90 # include <sys/uio.h>
91 # include <sys/buf.h>
92 # include <sys/stat.h>
93 # include <sys/file.h>
94 # include <sys/namei.h>
95 # include <sys/socket.h>
96 # include <sys/socketvar.h>
97 # include <sys/dirent.h>
98 # include <sys/user.h>
99 # include <sys/kauth.h>
100 # include <sys/uio.h>
101 # include <sys/buf.h>
102 # include <sys/stat.h>
103 # include <sys/file.h>
104 # include <sys/namei.h>
105 # include <sys/vnode.h>
106 # include <ufs/ffs/fs.h>
107 # include <ufs/ufs/quota.h>
108 # include <ufs/ufs/inode.h>
109 # include <ufs/ufs/extattr.h>
110 # include <ufs/ufs/ufsmount.h>
111 # ifndef MLEN
112 #  if 0
113 #   include <sys/mbuf.h>
114 #  endif /* 0 */
115 #  include <net/if.h>
116 # endif /* !MLEN */
117 # include <sys/protosw.h>
118 # include <sys/ioctl.h>
119
120 #elif defined(AFS_LINUX22_ENV)
121 # include <linux/version.h>
122 # ifdef HAVE_LINUX_CONFIG_H
123 #  include <linux/config.h>
124 # endif
125 # include <linux/linkage.h>
126 # include <linux/limits.h>
127 # include <linux/wait.h>
128 # include <linux/types.h>
129 # include <linux/vfs.h>
130 # include <linux/net.h>
131 # include <linux/kdev_t.h>
132 # include <linux/ioctl.h>
133 # if defined(AFS_LINUX26_ENV)
134 #  include <linux/backing-dev.h>
135 #  include <linux/pagemap.h>
136 #  include <linux/namei.h>
137 #  ifdef STRUCT_INODE_HAS_I_SECURITY
138 #   include <linux/security.h>
139 #  endif
140 #  include <linux/suspend.h>
141 # endif
142 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
143  * inclusion of uaccess.h.
144  */
145 # ifndef _LINUX_CODA_FS_I
146 #  define _LINUX_CODA_FS_I
147 #  define _CODA_HEADER_
148 #  define _CFS_HEADER_
149 struct coda_inode_info {
150 };
151 # endif
152 # ifndef _LINUX_XFS_FS_I
153 #  define _LINUX_XFS_FS_I
154 struct xfs_inode_info {
155 };
156 # endif
157 # include <asm/uaccess.h>
158 # include <linux/list.h>
159 # include <linux/dcache.h>
160 # include <linux/mount.h>
161 # include <linux/fs.h>
162 # include <linux/quota.h>
163 # include <linux/sched.h>
164 # include <linux/mm.h>
165 # include <linux/slab.h>
166 # include <linux/string.h>
167 # if defined(HAVE_LINUX_SEMAPHORE_H)
168 #  include <linux/semaphore.h>
169 # else
170 #  include <asm/semaphore.h>
171 # endif
172 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
173 #  include <linux/mutex.h>
174 # endif
175 # include <linux/errno.h>
176 # ifdef HAVE_LINUX_COMPLETION_H
177 #  include <linux/completion.h>
178 # endif
179 # if defined(HAVE_LINUX_EXPORTFS_H)
180 #  include <linux/exportfs.h>
181 # endif
182 # ifdef AFS_LINUX24_ENV
183 #  include <linux/pagemap.h>
184 # endif
185
186 #else /* AFS_LINUX22_ENV */
187 # if defined(AFS_DARWIN_ENV)
188 #  ifndef _MACH_ETAP_H_
189 #   define _MACH_ETAP_H_
190 typedef unsigned short etap_event_t;
191 #  endif
192 # endif
193
194 # include "h/errno.h"
195 # include "h/types.h"
196 # include "h/param.h"
197
198 # ifdef AFS_AUX_ENV
199 #  ifdef        PAGING
200 #   include "h/mmu.h"
201 #   include "h/seg.h"
202 #   include "h/page.h"
203 #   include "h/region.h"
204 #  endif /* PAGING */
205 #  include "h/sysmacros.h"
206 #  include "h/signal.h"
207 #  include "h/var.h"
208 # endif /* AFS_AUX_ENV */
209
210 # include "h/systm.h"
211 # include "h/time.h"
212
213 # ifdef AFS_AIX_ENV
214 #  ifdef AFS_AIX41_ENV
215 #   include "sys/statfs.h"
216 #  endif
217 #  ifdef AFS_AIX51_ENV
218 #   include "sys/acl.h"
219 #  endif
220 #  include "../h/file.h"
221 #  include "../h/fullstat.h"
222 #  include "../h/vattr.h"
223 #  include "../h/var.h"
224 #  include "../h/access.h"
225 # endif /* AFS_AIX_ENV */
226
227 # if defined(AFS_SGI_ENV)
228 #  include "values.h"
229 #  include "sys/sema.h"
230 #  include "sys/cmn_err.h"
231 #  ifdef AFS_SGI64_ENV
232 #   include <ksys/behavior.h>
233 /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
234  * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
235  * older headers like we want the old behavior, so we fake it. */
236 #   if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
237 #    define BHV_IS_BHVL(bhp) (0)
238 #   endif
239 #  endif /* AFS_SGI64_ENV */
240 #  include "fs/efs_inode.h"
241 #  include "sys/kmem.h"
242 #  include "sys/cred.h"
243 #  include "sys/resource.h"
244
245 /*
246  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
247  * is on (see afs_osi.h).
248  * In IRIX 6.5 we cannot have DEBUG turned on since certain
249  * system-defined structures have different members with DEBUG on, and
250  * this breaks our ability to interact with the rest of the kernel.
251  *
252  * Instead of using ASSERT(), we use our own osi_Assert().
253  */
254 #  if defined(AFS_SGI65_ENV) && !defined(DEBUG)
255 #   define DEBUG
256 #   include "sys/debug.h"
257 #   undef DEBUG
258 #  else
259 #   include "sys/debug.h"
260 #  endif
261
262 #  include "sys/statvfs.h"
263 #  include "sys/sysmacros.h"
264 #  include "sys/fs_subr.h"
265 #  include "sys/siginfo.h"
266 #  include "limits.h"
267 # endif /* AFS_SGI_ENV */
268
269 # if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
270 #  include "h/kernel.h"
271 # endif /* !SUN5 && !SGI */
272
273 # ifdef AFS_SUN5_ENV
274 #  include <sys/cmn_err.h>      /* for kernel printf() prototype */
275 # endif
276
277 # if    defined(AFS_SUN56_ENV)
278 #  include "h/vfs.h"            /* stops SUN56 socketvar.h warnings */
279 #  include "h/stropts.h"                /* stops SUN56 socketvar.h warnings */
280 #  include "h/stream.h"         /* stops SUN56 socketvar.h errors */
281 # endif
282
283 # ifdef AFS_SUN510_ENV
284 #  include <sys/cred_impl.h>
285 #  include <sys/policy.h>
286 # endif
287
288 # include "h/socket.h"
289 # include "h/socketvar.h"
290 # include "h/protosw.h"
291
292 # if defined(AFS_FBSD_ENV)
293 #  include "limits.h"
294 # endif
295
296 # ifdef AFS_HPUX_ENV
297 #  include "limits.h"
298 # endif
299
300 # if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || \
301   defined(AFS_FBSD_ENV) || defined(AFS_NBSD40_ENV)
302 #  include "h/dirent.h"
303 #  ifdef        AFS_SUN5_ENV
304 #   include "h/sysmacros.h"
305 #   include "h/fs/ufs_fsdir.h"
306 #  endif /* AFS_SUN5_ENV */
307 # else
308 #  include "h/dir.h"
309 # endif /* SGI || SUN || HPUX */
310
311 # if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) && \
312   !defined(AFS_NBSD40_ENV)
313 #  include "h/user.h"
314 # endif /* AFS_SGI64_ENV */
315 # define        MACH_USER_API   1
316 # if defined(AFS_FBSD_ENV)
317 #  include "h/bio.h"
318 #  include "h/filedesc.h"
319 # endif
320 # include "h/file.h"
321 # include "h/uio.h"
322 # include "h/buf.h"
323 # include "h/stat.h"
324
325
326 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
327 # ifdef AFS_SUN5_ENV
328 #  include "h/statvfs.h"
329 # endif /* AFS_SUN5_ENV */
330 # ifdef AFS_HPUX_ENV
331 struct vfspage;         /* for vnode.h compiler warnings */
332 #  include "h/swap.h"   /* for struct swpdbd, for vnode.h compiler warnings */
333 #  include "h/dbd.h"    /* for union idbd, for vnode.h compiler warnings */
334 #  ifdef AFS_HPUX110_ENV
335 #   include "h/resource.h"
336 #  endif
337 #  ifdef AFS_HPUX1123_ENV
338 #   include <sys/user.h>
339 #   include <sys/cred.h>
340 #  endif
341 # endif /* AFS_HPUX_ENV */
342 # if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
343 #  if defined(AFS_FBSD_ENV)
344 struct vop_getwritemount_args;
345 #  endif
346 #  include <sys/uio.h>
347 #  include <sys/mount.h>
348 #  include <sys/namei.h>
349 #  ifdef AFS_DARWIN80_ENV
350 #   include <sys/kauth.h>
351 #   include <string.h>
352 #  endif
353 #  include <sys/vnode.h>
354 #  include <sys/queue.h>
355 #  ifndef AFS_NBSD40_ENV
356 #   include <sys/malloc.h>
357 #  endif
358 #  ifdef AFS_FBSD_ENV
359 MALLOC_DECLARE(M_AFS);
360 #   include <ufs/ufs/dinode.h>
361 #   include <vm/vm.h>
362 #   include <vm/vm_extern.h>
363 #   include <vm/pmap.h>
364 #   include <vm/vm_map.h>
365 #   include <sys/lock.h>
366 #   include <sys/user.h>
367 #  else
368 #   include <sys/ubc.h>
369 #   define timeout_fcn_t mach_timeout_fcn_t
370 #   include <kern/sched_prim.h>
371 #  endif
372 #  undef timeout_fcn_t
373 #  define _DIR_H_
374 #  define doff_t          int32_t
375 #  ifndef AFS_DARWIN80_ENV
376 #   include <ufs/ufs/quota.h>
377 #   include <ufs/ufs/inode.h>
378 #   include <ufs/ffs/fs.h>
379 #  endif
380 # else
381 #  ifndef AFS_NBSD40_ENV
382 #   include "h/vfs.h"
383 #   include "h/vnode.h"
384 #  endif
385 #  ifdef        AFS_SUN5_ENV
386 #   include "h/fs/ufs_inode.h"
387 #   include "h/fs/ufs_mount.h"
388 #  else
389 #   if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_NBSD40_ENV)
390 #    include "ufs/inode.h"
391 #    if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_NBSD40_ENV)
392 #     include "ufs/mount.h"
393 #    endif /* !AFS_HPUX_ENV */
394 #   endif /* !AFS_AIX32_ENV */
395 #  endif /* AFS_SUN5_ENV */
396 # endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
397
398 /* These mainly deal with networking and rpc headers */
399 # include "netinet/in.h"
400 # undef MFREE                   /* defined at mount.h for AIX */
401 # ifdef AFS_SUN5_ENV
402 #  include "h/time.h"
403 # else
404 #  if !defined(AFS_HPUX_ENV)
405 #   include "h/mbuf.h"
406 #  endif
407 # endif /* AFS_SUN5_ENV */
408
409 # include "rpc/types.h"
410 # include "rx/xdr.h"
411
412 /* Miscellaneous headers */
413 # include "h/proc.h"
414 # if !defined(AFS_FBSD_ENV)
415 #  include "h/ioctl.h"
416 # endif /* AFS_FBSD_ENV */
417
418 # if    defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
419 #  include "h/proc_iface.h"
420 #  include "h/vas.h"
421 # endif
422
423 # if    defined(AFS_HPUX102_ENV)
424 #  include "h/unistd.h"
425 #  include "h/tty.h"
426 # endif
427
428 # 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) && !defined(AFS_NBSD40_ENV)
429
430 #  include "h/text.h"
431 # endif
432
433
434 # if    defined(AFS_AIX_ENV)
435 #  include "h/flock.h"          /* fcntl.h is a user-level include in aix */
436 # else
437 #  include "h/fcntl.h"
438 # endif /* AIX */
439
440 # if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
441 #  include "h/unistd.h"
442 # endif /* SGI || SUN */
443
444 # ifdef AFS_AIX32_ENV
445 #  include "h/vmuser.h"
446 # endif /* AFS_AIX32_ENV */
447
448 # if    defined(AFS_SUN5_ENV)
449 #  include <sys/tiuser.h>
450 #  include <sys/t_lock.h>
451 #  include <sys/mutex.h>
452 #  include <sys/vtrace.h>
453 #  include <sys/pathname.h>
454 #  include <sys/debug.h>
455 # endif
456
457 #endif /* AFS_LINUX22_ENV */
458
459 #endif /* __AFS_SYSINCLUDESH__  so idempotent */
460
461 #endif