Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Define a new module class for the bufq_strategy modules....
details: https://anonhg.NetBSD.org/src/rev/5bd5c812efbd
branches: trunk
changeset: 348933:5bd5c812efbd
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Nov 16 10:42:14 2016 +0000
description:
Define a new module class for the bufq_strategy modules. These need to
be loaded and intialized before autoconfigure runs, since some devices
(like disks and floppy drives) want to call bufq_alloc().
diffstat:
sys/kern/bufq_disksort.c | 6 +++---
sys/kern/bufq_fcfs.c | 6 +++---
sys/kern/bufq_priocscan.c | 6 +++---
sys/kern/bufq_readprio.c | 6 +++---
sys/kern/init_main.c | 10 ++++++++--
sys/kern/subr_bufq.c | 6 +++---
sys/sys/module.h | 5 +++--
7 files changed, 26 insertions(+), 19 deletions(-)
diffs (185 lines):
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/bufq_disksort.c
--- a/sys/kern/bufq_disksort.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/bufq_disksort.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufq_disksort.c,v 1.12 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: bufq_disksort.c,v 1.13 2016/11/16 10:42:14 pgoyette Exp $ */
/* NetBSD: subr_disk.c,v 1.61 2004/09/25 03:30:44 thorpej Exp */
/*-
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bufq_disksort.c,v 1.12 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bufq_disksort.c,v 1.13 2016/11/16 10:42:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -229,7 +229,7 @@
TAILQ_INIT(&disksort->bq_head);
}
-MODULE(MODULE_CLASS_MISC, bufq_disksort, NULL);
+MODULE(MODULE_CLASS_BUFQ, bufq_disksort, NULL);
static int
bufq_disksort_modcmd(modcmd_t cmd, void *opaque)
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/bufq_fcfs.c
--- a/sys/kern/bufq_fcfs.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/bufq_fcfs.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufq_fcfs.c,v 1.11 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: bufq_fcfs.c,v 1.12 2016/11/16 10:42:14 pgoyette Exp $ */
/* NetBSD: subr_disk.c,v 1.61 2004/09/25 03:30:44 thorpej Exp */
/*-
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bufq_fcfs.c,v 1.11 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bufq_fcfs.c,v 1.12 2016/11/16 10:42:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -153,7 +153,7 @@
TAILQ_INIT(&fcfs->bq_head);
}
-MODULE(MODULE_CLASS_MISC, bufq_fcfs, NULL);
+MODULE(MODULE_CLASS_BUFQ, bufq_fcfs, NULL);
static int
bufq_fcfs_modcmd(modcmd_t cmd, void *opaque)
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/bufq_priocscan.c
--- a/sys/kern/bufq_priocscan.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/bufq_priocscan.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufq_priocscan.c,v 1.19 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: bufq_priocscan.c,v 1.20 2016/11/16 10:42:14 pgoyette Exp $ */
/*-
* Copyright (c)2004,2005,2006,2008,2009,2011,2012 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bufq_priocscan.c,v 1.19 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bufq_priocscan.c,v 1.20 2016/11/16 10:42:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -444,7 +444,7 @@
}
}
-MODULE(MODULE_CLASS_MISC, bufq_priocscan, NULL);
+MODULE(MODULE_CLASS_BUFQ, bufq_priocscan, NULL);
static int
bufq_priocscan_modcmd(modcmd_t cmd, void *opaque)
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/bufq_readprio.c
--- a/sys/kern/bufq_readprio.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/bufq_readprio.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufq_readprio.c,v 1.14 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: bufq_readprio.c,v 1.15 2016/11/16 10:42:14 pgoyette Exp $ */
/* NetBSD: subr_disk.c,v 1.61 2004/09/25 03:30:44 thorpej Exp */
/*-
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bufq_readprio.c,v 1.14 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bufq_readprio.c,v 1.15 2016/11/16 10:42:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -281,7 +281,7 @@
TAILQ_INIT(&prio->bq_write);
}
-MODULE(MODULE_CLASS_MISC, bufq_readprio, NULL);
+MODULE(MODULE_CLASS_BUFQ, bufq_readprio, NULL);
static int
bufq_readprio_modcmd(modcmd_t cmd, void *opaque)
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/init_main.c
--- a/sys/kern/init_main.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/init_main.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.485 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: init_main.c,v 1.486 2016/11/16 10:42:14 pgoyette Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.485 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.486 2016/11/16 10:42:14 pgoyette Exp $");
#include "opt_ddb.h"
#include "opt_inet.h"
@@ -484,6 +484,12 @@
/* Initialize sockets thread(s) */
soinit1();
+ /*
+ * Initialize the bufq strategy modules - they may be needed
+ * by some devices during configuration
+ */
+ module_init_class(MODULE_CLASS_BUFQ);
+
/* Configure the system hardware. This will enable interrupts. */
configure();
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/kern/subr_bufq.c
--- a/sys/kern/subr_bufq.c Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/kern/subr_bufq.c Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_bufq.c,v 1.22 2016/11/16 00:46:46 pgoyette Exp $ */
+/* $NetBSD: subr_bufq.c,v 1.23 2016/11/16 10:42:14 pgoyette Exp $ */
/* NetBSD: subr_disk.c,v 1.70 2005/08/20 12:00:01 yamt Exp $ */
/*-
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_bufq.c,v 1.22 2016/11/16 00:46:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_bufq.c,v 1.23 2016/11/16 10:42:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -182,7 +182,7 @@
strlcpy(module_name, "bufq_", sizeof(module_name));
strlcat(module_name, strategy, sizeof(module_name));
mutex_exit(&bufq_mutex);
- (void) module_autoload(module_name, MODULE_CLASS_MISC);
+ (void) module_autoload(module_name, MODULE_CLASS_BUFQ);
mutex_enter(&bufq_mutex);
} while (gen != module_gen);
diff -r 9bcc66eee238 -r 5bd5c812efbd sys/sys/module.h
--- a/sys/sys/module.h Wed Nov 16 09:38:48 2016 +0000
+++ b/sys/sys/module.h Wed Nov 16 10:42:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: module.h,v 1.40 2016/01/18 16:46:08 pooka Exp $ */
+/* $NetBSD: module.h,v 1.41 2016/11/16 10:42:14 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,8 @@
MODULE_CLASS_VFS,
MODULE_CLASS_DRIVER,
MODULE_CLASS_EXEC,
- MODULE_CLASS_SECMODEL
+ MODULE_CLASS_SECMODEL,
+ MODULE_CLASS_BUFQ
} modclass_t;
/* Module sources: where did it come from? */
Home |
Main Index |
Thread Index |
Old Index