2 #include "../afs/param.h"
6 #include "../afs/sysincludes.h"
7 #include "../afs/afsincludes.h"
8 #include "../sys/syscall.h"
11 struct vfsconf afs_vfsconf;
12 extern struct vfsops afs_vfsops;
13 extern struct mount *afs_globalVFS;
14 extern int Afs_xsetgroups();
15 extern int afs_xioctl();
16 extern int afs3_syscall();
19 extern int setgroups();
20 kern_return_t afs_modload(struct kmod_info *ki, void *data)
22 if (sysent[AFS_SYSCALL].sy_call != nosys) {
23 printf("AFS_SYSCALL in use. aborting\n");
26 memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
27 strcpy(afs_vfsconf.vfc_name, "afs");
28 afs_vfsconf.vfc_vfsops=&afs_vfsops;
29 afs_vfsconf.vfc_typenum=VT_AFS;
30 afs_vfsconf.vfc_flags=MNT_NODEV;
31 if (vfsconf_add(&afs_vfsconf)) {
32 printf("AFS: vfsconf_add failed. aborting\n");
35 sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
36 sysent[SYS_ioctl].sy_call=afs_xioctl;
37 sysent[AFS_SYSCALL].sy_call=afs3_syscall;
38 sysent[AFS_SYSCALL].sy_narg = 5;
39 sysent[AFS_SYSCALL].sy_parallel = 0;
41 sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL;
45 kern_return_t afs_modunload(struct kmod_info *ki, void *data)
49 if (vfsconf_del("afs"))
51 /* give up syscall entries for ioctl & setgroups, which we've stolen */
52 sysent[SYS_ioctl].sy_call = ioctl;
53 sysent[SYS_setgroups].sy_call = setgroups;
54 /* give up the stolen syscall entry */
55 sysent[AFS_SYSCALL].sy_narg = 0;
56 sysent[AFS_SYSCALL].sy_call = nosys;
60 KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)