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