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