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 extern int maxvfsconf;
21 kern_return_t afs_modload(struct kmod_info *ki, void *data)
23 if (sysent[AFS_SYSCALL].sy_call != nosys) {
24 printf("AFS_SYSCALL in use. aborting\n");
27 memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
28 strcpy(afs_vfsconf.vfc_name, "afs");
29 afs_vfsconf.vfc_vfsops=&afs_vfsops;
30 afs_vfsconf.vfc_typenum=maxvfsconf++;/* oddly not VT_AFS */
31 afs_vfsconf.vfc_flags=MNT_NODEV;
32 if (vfsconf_add(&afs_vfsconf)) {
33 printf("AFS: vfsconf_add failed. aborting\n");
36 sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
37 sysent[SYS_ioctl].sy_call=afs_xioctl;
38 sysent[AFS_SYSCALL].sy_call=afs3_syscall;
39 sysent[AFS_SYSCALL].sy_narg = 5;
40 sysent[AFS_SYSCALL].sy_parallel = 0;
42 sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL;
46 kern_return_t afs_modunload(struct kmod_info *ki, void *data)
50 if (vfsconf_del("afs"))
52 /* give up syscall entries for ioctl & setgroups, which we've stolen */
53 sysent[SYS_ioctl].sy_call = ioctl;
54 sysent[SYS_setgroups].sy_call = setgroups;
55 /* give up the stolen syscall entry */
56 sysent[AFS_SYSCALL].sy_narg = 0;
57 sysent[AFS_SYSCALL].sy_call = nosys;
61 KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)