1 #include "../afs/param.h"
2 #include "../afs/sysincludes.h"
3 #include "../afs/afsincludes.h"
4 #include "../sys/syscall.h"
6 #define VERSION "1.0.3"
9 struct vfsconf afs_vfsconf;
10 extern struct vfsops afs_vfsops;
11 extern struct mount *afs_globalVFS;
12 extern int Afs_xsetgroups();
13 extern int afs_xioctl();
14 extern int afs3_syscall();
17 extern int setgroups();
18 kern_return_t afs_modload(struct kmod_info *ki, void *data)
20 if (sysent[AFS_SYSCALL].sy_call != nosys) {
21 printf("AFS_SYSCALL in use. aborting\n");
24 bzero(&afs_vfsconf, sizeof(struct vfsconf));
25 strcpy(afs_vfsconf.vfc_name, "afs");
26 afs_vfsconf.vfc_vfsops=&afs_vfsops;
27 afs_vfsconf.vfc_typenum=VT_AFS;
28 afs_vfsconf.vfc_flags=MNT_NODEV;
29 if (vfsconf_add(&afs_vfsconf)) {
30 printf("AFS: vfsconf_add failed. aborting\n");
33 sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
34 sysent[SYS_ioctl].sy_call=afs_xioctl;
35 sysent[AFS_SYSCALL].sy_call=afs3_syscall;
36 sysent[AFS_SYSCALL].sy_narg = 5;
37 sysent[AFS_SYSCALL].sy_parallel = 0;
39 sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL;
43 kern_return_t afs_modunload(struct kmod_info *ki, void *data)
47 if (vfsconf_del("afs"))
49 /* give up syscall entries for ioctl & setgroups, which we've stolen */
50 sysent[SYS_ioctl].sy_call = ioctl;
51 sysent[SYS_setgroups].sy_call = setgroups;
52 /* give up the stolen syscall entry */
53 sysent[AFS_SYSCALL].sy_narg = 0;
54 sysent[AFS_SYSCALL].sy_call = nosys;
58 KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)