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