Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs load lfs syscalls in modload



details:   https://anonhg.NetBSD.org/src/rev/af64adda85d6
branches:  trunk
changeset: 752636:af64adda85d6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Mar 02 19:34:49 2010 +0000

description:
load lfs syscalls in modload

diffstat:

 sys/ufs/lfs/lfs_vfsops.c |  23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diffs (66 lines):

diff -r ac6ece18065b -r af64adda85d6 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Tue Mar 02 19:34:26 2010 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Tue Mar 02 19:34:49 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vfsops.c,v 1.285 2010/03/02 19:30:34 pooka Exp $   */
+/*     $NetBSD: lfs_vfsops.c,v 1.286 2010/03/02 19:34:49 pooka Exp $   */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.285 2010/03/02 19:30:34 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.286 2010/03/02 19:34:49 pooka Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -92,6 +92,9 @@
 #include <sys/conf.h>
 #include <sys/kauth.h>
 #include <sys/module.h>
+#include <sys/syscallvar.h>
+#include <sys/syscall.h>
+#include <sys/syscallargs.h>
 
 #include <miscfs/specfs/specdev.h>
 
@@ -340,6 +343,14 @@
 #endif
 }
 
+/* old cleaner syscall interface.  see VOP_FCNTL() */
+static const struct syscall_package lfs_syscalls[] = {
+       { SYS_lfs_bmapv,        0, (sy_call_t *)sys_lfs_bmapv           },
+       { SYS_lfs_markv,        0, (sy_call_t *)sys_lfs_markv           },
+       { SYS_lfs_segclean,     0, (sy_call_t *)sys___lfs_segwait50     },
+       { 0, 0, NULL },
+};
+
 static int
 lfs_modcmd(modcmd_t cmd, void *arg)
 {
@@ -347,15 +358,21 @@
 
        switch (cmd) {
        case MODULE_CMD_INIT:
+               error = syscall_establish(NULL, lfs_syscalls);
+               if (error)
+                       return error;
                error = vfs_attach(&lfs_vfsops);
-               if (error != 0)
+               if (error != 0) {
+                       syscall_disestablish(NULL, lfs_syscalls);
                        break;
+               }
                lfs_sysctl_setup(&lfs_sysctl_log);
                break;
        case MODULE_CMD_FINI:
                error = vfs_detach(&lfs_vfsops);
                if (error != 0)
                        break;
+               syscall_disestablish(NULL, lfs_syscalls);
                sysctl_teardown(&lfs_sysctl_log);
                break;
        default:



Home | Main Index | Thread Index | Old Index