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