Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/nfs Add the initial module(9) infrastructure



details:   https://anonhg.NetBSD.org/src/rev/8a347e7a5f90
branches:  trunk
changeset: 348979:8a347e7a5f90
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Nov 18 22:41:18 2016 +0000

description:
Add the initial module(9) infrastructure

diffstat:

 sys/fs/nfs/client/nfs_clmodule.c   |  48 ++++++++++++++++++++++++++++++++++++++
 sys/fs/nfs/common/nfs_module.c     |  48 ++++++++++++++++++++++++++++++++++++++
 sys/fs/nfs/files.newnfs            |   5 +++-
 sys/fs/nfs/server/nfs_nfsdmodule.c |  48 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+), 1 deletions(-)

diffs (189 lines):

diff -r bc4148e633da -r 8a347e7a5f90 sys/fs/nfs/client/nfs_clmodule.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/fs/nfs/client/nfs_clmodule.c  Fri Nov 18 22:41:18 2016 +0000
@@ -0,0 +1,48 @@
+/* $NetBSD: nfs_clmodule.c,v 1.1 2016/11/18 22:41:19 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/module.h>
+#include <sys/param.h>
+
+MODULE(MODULE_CLASS_MISC, nfs_client, "nfs_common,sysmon_taskq");
+
+static int
+nfs_client_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r bc4148e633da -r 8a347e7a5f90 sys/fs/nfs/common/nfs_module.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/fs/nfs/common/nfs_module.c    Fri Nov 18 22:41:18 2016 +0000
@@ -0,0 +1,48 @@
+/* $NetBSD: nfs_module.c,v 1.1 2016/11/18 22:41:19 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/module.h>
+#include <sys/param.h>
+
+MODULE(MODULE_CLASS_MISC, nfs_common, NULL);
+
+static int
+nfs_common_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r bc4148e633da -r 8a347e7a5f90 sys/fs/nfs/files.newnfs
--- a/sys/fs/nfs/files.newnfs   Fri Nov 18 22:37:50 2016 +0000
+++ b/sys/fs/nfs/files.newnfs   Fri Nov 18 22:41:18 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.newnfs,v 1.5 2016/11/18 09:58:38 pgoyette Exp $
+#      $NetBSD: files.newnfs,v 1.6 2016/11/18 22:41:18 pgoyette Exp $
 
 deffs NEW_NFSCLIENT
 defflag opt_newnfs.h                   DTRACEALL
@@ -10,6 +10,7 @@
 
 # XXX
 define new_nfsclient: vfs, net
+file   fs/nfs/client/nfs_clmodule.c     new_nfsclient
 file   fs/nfs/client/nfs_clbio.c        new_nfsclient
 file   fs/nfs/client/nfs_clcomsubs.c    new_nfsclient
 file   fs/nfs/client/nfs_clkdtrace.c    new_nfsclient & (dtnfscl | dtraceall)
@@ -24,6 +25,7 @@
 file   fs/nfs/client/nfs_clvnops.c      new_nfsclient
 file   fs/nfs/common/bootp_subr.c       new_nfs_boot_bootp & new_nfsclient
 file   fs/nfs/common/krpc_subr.c        new_nfs_boot_bootp & new_nfsclient
+file   fs/nfs/common/nfs_module.c       new_nfsclient | new_nfsserver
 file   fs/nfs/common/nfs_commonacl.c    new_nfsclient | new_nfsserver
 file   fs/nfs/common/nfs_commonkrpc.c   new_nfsclient | new_nfsserver
 file   fs/nfs/common/nfs_commonport.c   new_nfsclient | new_nfsserver
@@ -39,6 +41,7 @@
 file   fs/nfs/nlm/nlm_prot_svc.c        new_nfslockd | new_nfsserver
 file   fs/nfs/nlm/nlm_prot_xdr.c        new_nfslockd | new_nfsserver
 file   fs/nfs/nlm/sm_inter_xdr.c        new_nfslockd | new_nfsserver
+file   fs/nfs/server/nfs_nfsdmodule.c   new_nfsserver
 file   fs/nfs/server/nfs_fha_new.c      new_nfsserver
 file   fs/nfs/server/nfs_nfsdcache.c    new_nfsserver
 file   fs/nfs/server/nfs_nfsdkrpc.c     new_nfsserver
diff -r bc4148e633da -r 8a347e7a5f90 sys/fs/nfs/server/nfs_nfsdmodule.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/fs/nfs/server/nfs_nfsdmodule.c        Fri Nov 18 22:41:18 2016 +0000
@@ -0,0 +1,48 @@
+/* $NetBSD: nfs_nfsdmodule.c,v 1.1 2016/11/18 22:41:19 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/module.h>
+#include <sys/param.h>
+
+MODULE(MODULE_CLASS_MISC, nfs_server, "nfs_common");
+
+static int
+nfs_server_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}



Home | Main Index | Thread Index | Old Index