Page MenuHomeFreeBSD

D36173.diff
No OneTemporary

D36173.diff

diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -239,6 +239,29 @@
mtx_unlock(&dom_mtx);
}
+void
+domain_remove(void *data)
+{
+ struct domain *dp = (struct domain *)data;
+
+ if ((dp->dom_flags & DOMF_UNLOADABLE) == 0)
+ return;
+
+ mtx_lock(&dom_mtx);
+ if (domains == dp) {
+ domains = dp->dom_next;
+ } else {
+ struct domain *curr;
+ for (curr = domains; curr != NULL; curr = curr->dom_next) {
+ if (curr->dom_next == dp) {
+ curr->dom_next = dp->dom_next;
+ break;
+ }
+ }
+ }
+ mtx_unlock(&dom_mtx);
+}
+
/* ARGSUSED*/
static void
domaininit(void *dummy)
diff --git a/sys/sys/domain.h b/sys/sys/domain.h
--- a/sys/sys/domain.h
+++ b/sys/sys/domain.h
@@ -71,11 +71,13 @@
/* dom_flags */
#define DOMF_SUPPORTED 0x0001 /* System supports this domain. */
#define DOMF_INITED 0x0002 /* Initialized in the default vnet. */
+#define DOMF_UNLOADABLE 0x0004 /* Can be unloaded */
#ifdef _KERNEL
extern int domain_init_status;
extern struct domain *domains;
void domain_add(void *);
+void domain_remove(void *);
void domain_init(void *);
#ifdef VIMAGE
void vnet_domain_init(void *);
@@ -85,6 +87,8 @@
#define DOMAIN_SET(name) \
SYSINIT(domain_add_ ## name, SI_SUB_PROTO_DOMAIN, \
SI_ORDER_FIRST, domain_add, & name ## domain); \
+ SYSUNINIT(domain_remove_ ## name, SI_SUB_PROTO_DOMAIN, \
+ SI_ORDER_FIRST, domain_remove, & name ## domain); \
SYSINIT(domain_init_ ## name, SI_SUB_PROTO_DOMAIN, \
SI_ORDER_SECOND, domain_init, & name ## domain);
#endif /* _KERNEL */

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 3:32 AM (22 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14729419
Default Alt Text
D36173.diff (1 KB)

Event Timeline