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