Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Make dksubr.c into a module, and make the cgd and dm mod...
details: https://anonhg.NetBSD.org/src/rev/3c9a44c87226
branches: trunk
changeset: 325556:3c9a44c87226
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sat Dec 28 19:25:07 2013 +0000
description:
Make dksubr.c into a module, and make the cgd and dm modules depend on
it.
Now that cgd is completely modularized, descend into modules/cgd to
actually create the module.
diffstat:
sys/dev/cgd.c | 6 +++---
sys/dev/dksubr.c | 23 +++++++++++++++++++++--
sys/dev/dm/device-mapper.c | 4 ++--
sys/modules/Makefile | 4 +++-
sys/modules/dk_subr/Makefile | 10 ++++++++++
5 files changed, 39 insertions(+), 8 deletions(-)
diffs (139 lines):
diff -r d8e4588825d0 -r 3c9a44c87226 sys/dev/cgd.c
--- a/sys/dev/cgd.c Sat Dec 28 18:06:41 2013 +0000
+++ b/sys/dev/cgd.c Sat Dec 28 19:25:07 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.82 2013/09/12 12:28:49 martin Exp $ */
+/* $NetBSD: cgd.c,v 1.83 2013/12/28 19:25:07 pgoyette Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.82 2013/09/12 12:28:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.83 2013/12/28 19:25:07 pgoyette Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -973,7 +973,7 @@
}
#endif
-MODULE(MODULE_CLASS_DRIVER, cgd, NULL);
+MODULE(MODULE_CLASS_DRIVER, cgd, "dk_subr");
#ifdef _MODULE
CFDRIVER_DECL(cgd, DV_DISK, NULL);
diff -r d8e4588825d0 -r 3c9a44c87226 sys/dev/dksubr.c
--- a/sys/dev/dksubr.c Sat Dec 28 18:06:41 2013 +0000
+++ b/sys/dev/dksubr.c Sat Dec 28 19:25:07 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.48 2013/05/29 23:37:10 christos Exp $ */
+/* $NetBSD: dksubr.c,v 1.49 2013/12/28 19:25:07 pgoyette Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.48 2013/05/29 23:37:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.49 2013/12/28 19:25:07 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -45,6 +45,7 @@
#include <sys/vnode.h>
#include <sys/fcntl.h>
#include <sys/namei.h>
+#include <sys/module.h>
#include <dev/dkvar.h>
@@ -64,6 +65,8 @@
#define DPRINTF_FOLLOW(y)
#endif
+static int dk_subr_modcmd(modcmd_t, void *);
+
#define DKLABELDEV(dev) \
(MAKEDISKDEV(major((dev)), DISKUNIT((dev)), RAW_PART))
@@ -680,3 +683,19 @@
(void) vn_close(vp, FREAD | FWRITE, l->l_cred);
return error;
}
+
+MODULE(MODULE_CLASS_MISC, dk_subr, NULL);
+
+static int
+dk_subr_modcmd(modcmd_t cmd, void *arg)
+{
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ case MODULE_CMD_FINI:
+ return 0;
+ case MODULE_CMD_STAT:
+ case MODULE_CMD_AUTOUNLOAD:
+ default:
+ return ENOTTY;
+ }
+}
diff -r d8e4588825d0 -r 3c9a44c87226 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c Sat Dec 28 18:06:41 2013 +0000
+++ b/sys/dev/dm/device-mapper.c Sat Dec 28 19:25:07 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device-mapper.c,v 1.31 2013/10/18 19:56:30 christos Exp $ */
+/* $NetBSD: device-mapper.c,v 1.32 2013/12/28 19:25:07 pgoyette Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -147,7 +147,7 @@
/* Autoconf defines */
CFDRIVER_DECL(dm, DV_DISK, NULL);
-MODULE(MODULE_CLASS_DRIVER, dm, NULL);
+MODULE(MODULE_CLASS_DRIVER, dm, "dk_subr");
/* New module handle routine */
static int
diff -r d8e4588825d0 -r 3c9a44c87226 sys/modules/Makefile
--- a/sys/modules/Makefile Sat Dec 28 18:06:41 2013 +0000
+++ b/sys/modules/Makefile Sat Dec 28 19:25:07 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.128 2013/12/16 23:54:26 lneto Exp $
+# $NetBSD: Makefile,v 1.129 2013/12/28 19:25:07 pgoyette Exp $
.include <bsd.own.mk>
@@ -10,6 +10,7 @@
SUBDIR+= aio
SUBDIR+= bpf
SUBDIR+= cd9660
+SUBDIR+= cgd
SUBDIR+= coda
SUBDIR+= coda5
SUBDIR+= compat
@@ -17,6 +18,7 @@
SUBDIR+= coredump
SUBDIR+= chfs
SUBDIR+= dbcool
+SUBDIR+= dk_subr
SUBDIR+= efs
SUBDIR+= ext2fs
SUBDIR+= exec_script
diff -r d8e4588825d0 -r 3c9a44c87226 sys/modules/dk_subr/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/dk_subr/Makefile Sat Dec 28 19:25:07 2013 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2013/12/28 19:25:07 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/dev
+
+KMOD= dk_subr
+SRCS= dksubr.c
+
+.include <bsd.kmodule.mk>
Home |
Main Index |
Thread Index |
Old Index