#include <sys/module.h>
#include <sys/sysproto.h>
#include <sys/syscall.h>
-#include <sys/sysent.h>
extern struct vfsops afs_vfsops;
extern struct vnodeopv_desc afs_vnodeop_opv_desc;
extern struct mount *afs_globalVFS;
-static struct vfsconf afs_vfsconf;
MALLOC_DEFINE(M_AFS, "afsmisc", "memory used by the AFS filesystem");
-extern int afs3_syscall();
-extern int Afs_xsetgroups();
-extern int afs_xioctl();
+#ifdef AFS_FBSD60_ENV
+VFS_SET(afs_vfsops, afs, VFCF_NETWORK);
+#else
+int afs_module_handler(module_t mod, int what, void *arg);
+
+static struct vfsconf afs_vfsconf;
+static moduledata_t afs_mod = {
+ "afs",
+ afs_module_handler,
+ &afs_mod
+};
+DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
+#endif
+
+#ifndef AFS_FBSD60_ENV
int
afs_module_handler(module_t mod, int what, void *arg)
{
- static sy_call_t *old_handler;
static int inited = 0;
int error = 0;
error = EBUSY;
break;
}
- if (sysent[AFS_SYSCALL].sy_call != nosys
- && sysent[AFS_SYSCALL].sy_call != lkmnosys) {
- printf("AFS_SYSCALL in use. aborting\n");
- error = EBUSY;
- break;
- }
memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
#ifdef AFS_FBSD53_ENV
afs_vfsconf.vfc_version = VFS_VERSION;
if ((error = vfs_register(&afs_vfsconf)) != 0)
break;
vfs_add_vnodeops(&afs_vnodeop_opv_desc);
- osi_Init();
-#if 0
- sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
- sysent[SYS_ioctl].sy_call = afs_xioctl;
-#endif
- old_handler = sysent[AFS_SYSCALL].sy_call;
- sysent[AFS_SYSCALL].sy_call = afs3_syscall;
- sysent[AFS_SYSCALL].sy_narg = 5;
inited = 1;
break;
case MOD_UNLOAD:
error = 0;
break;
}
- if (afs_globalVFS) {
- error = EBUSY;
- break;
- }
if ((error = vfs_unregister(&afs_vfsconf)) != 0) {
break;
}
vfs_rm_vnodeops(&afs_vnodeop_opv_desc);
-#if 0
- sysent[SYS_ioctl].sy_call = ioctl;
- sysent[SYS_setgroups].sy_call = setgroups;
-#endif
- sysent[AFS_SYSCALL].sy_narg = 0;
- sysent[AFS_SYSCALL].sy_call = old_handler;
break;
}
return (error);
}
-
-
-static moduledata_t afs_mod = {
- "afs",
- afs_module_handler,
- &afs_mod
-};
-
-DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
+#endif