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