6 #include "afs/sysincludes.h"
7 #include "afsincludes.h"
8 #ifdef AFS_DARWIN60_ENV /* not in Kernel.framework anymore !?! */
9 #include <sys/syscall.h>
11 #include "sys/syscall.h"
13 #include <mach/kmod.h>
15 struct vfsconf afs_vfsconf;
16 extern struct vfsops afs_vfsops;
17 extern struct mount *afs_globalVFS;
18 extern int Afs_xsetgroups();
19 extern int afs_xioctl();
20 extern int afs3_syscall();
23 extern int setgroups();
24 extern int maxvfsconf;
25 kern_return_t afs_modload(struct kmod_info *ki, void *data)
27 if (sysent[AFS_SYSCALL].sy_call != nosys) {
28 printf("AFS_SYSCALL in use. aborting\n");
31 memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
32 strcpy(afs_vfsconf.vfc_name, "afs");
33 afs_vfsconf.vfc_vfsops=&afs_vfsops;
34 afs_vfsconf.vfc_typenum=maxvfsconf++;/* oddly not VT_AFS */
35 afs_vfsconf.vfc_flags=MNT_NODEV;
36 if (vfsconf_add(&afs_vfsconf)) {
37 printf("AFS: vfsconf_add failed. aborting\n");
40 sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
41 sysent[SYS_ioctl].sy_call=afs_xioctl;
42 sysent[AFS_SYSCALL].sy_call=afs3_syscall;
43 sysent[AFS_SYSCALL].sy_narg = 5;
44 sysent[AFS_SYSCALL].sy_parallel = 0;
46 sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL;
50 kern_return_t afs_modunload(struct kmod_info *ki, void *data)
54 if (vfsconf_del("afs"))
56 /* give up syscall entries for ioctl & setgroups, which we've stolen */
57 sysent[SYS_ioctl].sy_call = ioctl;
58 sysent[SYS_setgroups].sy_call = setgroups;
59 /* give up the stolen syscall entry */
60 sysent[AFS_SYSCALL].sy_narg = 0;
61 sysent[AFS_SYSCALL].sy_call = nosys;
65 KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload, afs_modunload)