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