2 * Copyright 2000, International Business Machines Corporation and others.
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
11 #include <UKERNEL/sysincludes.h>
14 #ifndef __AFS_SYSINCLUDESH__
15 #define __AFS_SYSINCLUDESH__ 1
18 #include <sys/errno.h>
19 #include <sys/types.h>
20 #include <sys/param.h>
22 #include <sys/queue.h>
23 #include <sys/resourcevar.h>
24 #include <sys/kernel.h>
27 #include <sys/filedesc.h>
29 #include <sys/socket.h>
30 #include <sys/socketvar.h>
31 #include <sys/dirent.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>
45 #include <ufs/ufs/ufsmount.h>
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>
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>
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>
81 #ifndef KEY_ALLOC_IN_QUOTA
82 #define KEY_ALLOC_IN_QUOTA 1
86 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
87 * inclusion of uaccess.h.
89 #ifndef _LINUX_CODA_FS_I
90 #define _LINUX_CODA_FS_I
93 struct coda_inode_info {
96 #ifndef _LINUX_XFS_FS_I
97 #define _LINUX_XFS_FS_I
98 struct xfs_inode_info {
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>
115 #include <linux/errno.h>
116 #ifdef COMPLETION_H_EXISTS
117 #include <linux/completion.h>
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;
127 #if !defined(AFS_OSF_ENV)
137 #include "h/region.h"
139 #include "h/sysmacros.h"
140 #include "h/signal.h"
142 #endif /* AFS_AUX_ENV */
149 #include "sys/statfs.h"
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 */
161 #if defined(AFS_SGI_ENV)
163 #include "sys/sema.h"
164 #include "sys/cmn_err.h"
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)
173 #endif /* AFS_SGI64_ENV */
174 #include "fs/efs_inode.h"
175 #ifdef AFS_SGI_EFS_IOPS_ENV
176 #include "sgiefs/efs.h"
178 #include "sys/kmem.h"
179 #include "sys/cred.h"
180 #include "sys/resource.h"
183 * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
184 * is on (see afs_osi.h).
185 * In IRIX 6.5 we cannot have DEBUG turned on since certain
186 * system-defined structures have different members with DEBUG on, and
187 * this breaks our ability to interact with the rest of the kernel.
189 * Instead of using ASSERT(), we use our own osi_Assert().
191 #if defined(AFS_SGI65_ENV) && !defined(DEBUG)
193 #include "sys/debug.h"
196 #include "sys/debug.h"
199 #include "sys/statvfs.h"
200 #include "sys/sysmacros.h"
201 #include "sys/fs_subr.h"
202 #include "sys/siginfo.h"
203 #endif /* AFS_SGI_ENV */
205 #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
206 # include "h/kernel.h"
207 #endif /* !SUN5 && !SGI */
210 #include <sys/cmn_err.h> /* for kernel printf() prototype */
213 #if defined(AFS_SUN56_ENV)
214 #include "h/vfs.h" /* stops SUN56 socketvar.h warnings */
215 #include "h/stropts.h" /* stops SUN56 socketvar.h warnings */
216 #include "h/stream.h" /* stops SUN56 socketvar.h errors */
219 #ifdef AFS_SUN510_ENV
220 #include <sys/cred_impl.h>
221 #include <sys/policy.h>
224 #include "h/socket.h"
225 #include "h/socketvar.h"
226 #include "h/protosw.h"
228 #if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
229 # include "h/dirent.h"
231 # include "h/sysmacros.h"
232 # include "h/fs/ufs_fsdir.h"
233 # endif /* AFS_SUN5_ENV */
236 #endif /* SGI || SUN || HPUX */
238 #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV)
240 #endif /* AFS_SGI64_ENV */
241 #define MACH_USER_API 1
242 #if defined(AFS_FBSD50_ENV)
244 #include "h/filedesc.h"
252 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
254 # include "h/statvfs.h"
255 # endif /* AFS_SUN5_ENV */
257 struct vfspage; /* for vnode.h compiler warnings */
258 # include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */
259 # include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */
260 #ifdef AFS_HPUX110_ENV
261 # include "h/resource.h"
263 #ifdef AFS_HPUX1123_ENV
264 # include <sys/user.h>
265 # include <sys/cred.h>
267 # endif /* AFS_HPUX_ENV */
268 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
269 # if defined(AFS_FBSD50_ENV)
270 struct vop_getwritemount_args;
272 # include <sys/uio.h>
273 # include <sys/mount.h>
274 # include <sys/namei.h>
275 #ifdef AFS_DARWIN80_ENV
276 # include <sys/kauth.h>
279 # include <sys/vnode.h>
280 # include <sys/queue.h>
281 # include <sys/malloc.h>
283 # include <sys/ubc.h>
284 #define timeout_fcn_t mach_timeout_fcn_t
285 # include <kern/sched_prim.h>
287 MALLOC_DECLARE(M_AFS);
288 # include <ufs/ufs/dinode.h>
290 # include <vm/vm_extern.h>
291 # include <vm/pmap.h>
292 # include <vm/vm_map.h>
293 # include <sys/lock.h>
294 # include <sys/user.h>
298 #define doff_t int32_t
299 #ifndef AFS_DARWIN80_ENV
300 # include <ufs/ufs/quota.h>
301 # include <ufs/ufs/inode.h>
302 # include <ufs/ffs/fs.h>
306 # include "h/vnode.h"
308 # include "h/fs/ufs_inode.h"
309 # include "h/fs/ufs_mount.h"
311 # if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
312 # include "ufs/inode.h"
313 # if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
314 # include "ufs/mount.h"
315 # endif /* !AFS_HPUX_ENV */
316 # endif /* !AFS_AIX32_ENV */
317 # endif /* AFS_SUN5_ENV */
318 #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
320 /* These mainly deal with networking and rpc headers */
321 #include "netinet/in.h"
322 #undef MFREE /* defined at mount.h for AIX */
326 #if !defined(AFS_HPUX_ENV)
329 #endif /* AFS_SUN5_ENV */
331 #include "rpc/types.h"
334 /* Miscellaneous headers */
336 #if !defined(AFS_FBSD_ENV)
338 #endif /* AFS_FBSD_ENV */
340 #if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
341 #include "h/proc_iface.h"
345 #if defined(AFS_HPUX102_ENV)
346 #include "h/unistd.h"
350 #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)
356 #if defined(AFS_AIX_ENV)
357 # include "h/flock.h" /* fcntl.h is a user-level include in aix */
359 # include "h/fcntl.h"
362 #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
363 # include "h/unistd.h"
364 #endif /* SGI || SUN */
367 # include "h/vmuser.h"
368 #endif /* AFS_AIX32_ENV */
370 #if defined(AFS_SUN5_ENV)
371 #include <sys/tiuser.h>
372 #include <sys/t_lock.h>
373 #include <sys/mutex.h>
374 #include <sys/vtrace.h>
375 #include <sys/pathname.h>
376 #include <sys/debug.h>
379 #else /* ! AFS_OSF_ENV */
380 /* All of the OSF/1 stuff is here */
381 #include <net/net_globals.h>
383 #include <sys/types.h>
384 #include <sys/param.h>
385 #include <sys/systm.h>
386 #include <sys/time.h>
387 #include <sys/kernel.h>
388 #include <sys/socket.h>
389 #include <sys/socketvar.h>
390 #include <sys/protosw.h>
392 #include <sys/user.h>
393 #include <sys/file.h>
396 #include <sys/stat.h>
397 #include <sys/vnode.h>
398 #include <ufs/inode.h>
399 #include <sys/mount.h>
400 #include <vm/vm_page.h>
401 #include <mach/vm_param.h>
402 #include <kern/parallel.h>
403 #include <mach/mach_types.h>
404 #ifndef AFS_OSF30_ENV
405 #include <kern/mfs.h>
407 #include <mach/vm_param.h>
408 #include <kern/parallel.h>
410 /* These mainly deal with networking and rpc headers */
411 #include <netinet/in.h>
412 #include <sys/mbuf.h>
413 #include <rpc/types.h>
421 #endif /* AFS_OSF_ENV */
424 #include <sys/proc.h>
425 #include <sys/ioctl.h>
427 #endif /* AFS_OSF_ENV */
428 #endif /* AFS_LINUX22_ENV */
429 #endif /* AFS_OBSD_ENV */
431 #endif /* __AFS_SYSINCLUDESH__ so idempotent */