NetBSD: update kernel module glue for NetBSD 6.99.x
authorJonathan A. Kollasch <jakllsch@kollasch.net>
Thu, 17 Apr 2014 17:55:34 +0000 (12:55 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 May 2014 03:00:25 +0000 (23:00 -0400)
Change-Id: I4fe5ccb33ec823a6df3a73e94247a0a42b970e57
Reviewed-on: http://gerrit.openafs.org/11089
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/NBSD/osi_kmod.c

index e8a3293..f658565 100644 (file)
@@ -66,6 +66,14 @@ static sy_call_t *old_ioctl;
 
 MODULE(MODULE_CLASS_VFS, openafs, NULL);
 
+#if defined(AFS_NBSD70_ENV)
+#define SYS_NOSYSCALL sys_nomodule
+#elif defined(AFS_NBSD60_ENV)
+#define SYS_NOSYSCALL sys_nosys
+#else
+#define SYS_NOSYSCALL sys_lkmnosys
+#endif
+
 static int
 openafs_modcmd(modcmd_t cmd, void *arg)
 {
@@ -86,14 +94,11 @@ openafs_modcmd(modcmd_t cmd, void *arg)
                old_sysent = se[AFS_SYSCALL];
                old_setgroups = se[SYS_setgroups].sy_call;
                old_ioctl = se[SYS_ioctl].sy_call;
-#if defined(AFS_NBSD60_ENV)
-# ifndef RUMP
-               if (old_sysent.sy_call == sys_nosys) {
-# else
+
+#if defined(RUMP)
                if (true) {
-# endif
 #else
-               if (old_sysent.sy_call == sys_lkmnosys) {
+               if (old_sysent.sy_call == SYS_NOSYSCALL) {
 #endif
 #if defined(AFS_NBSD60_ENV)
                        kernconfig_lock();
@@ -124,6 +129,11 @@ openafs_modcmd(modcmd_t cmd, void *arg)
                if (error != 0)
                        break;
                break;
+#if defined(AFS_NBSD70_ENV)
+       case MODULE_CMD_AUTOUNLOAD:
+               error = EBUSY;
+               break;
+#endif
        default:
                error = ENOTTY;
                break;