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