summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-04-19 15:26:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-04-19 15:26:53 +0000
commit43dfa343205f93e307354f2eb9bb65eee19711ed (patch)
treeb9bc3b266acef6eed57c4345a94802633e9968cb /sys/kern
parent9781289811c33accd41427618263b031a443438a (diff)
Add a new EX_FILLED flag to make extent_create() create an extent map that
has all space allocated such that we can make holes in it using extent_free(). ok miod@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_extent.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c
index 8053c1c9583..c309a1a123a 100644
--- a/sys/kern/subr_extent.c
+++ b/sys/kern/subr_extent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_extent.c,v 1.36 2009/04/10 20:57:04 kettenis Exp $ */
+/* $OpenBSD: subr_extent.c,v 1.37 2009/04/19 15:26:52 kettenis Exp $ */
/* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */
/*-
@@ -228,6 +228,18 @@ extent_create(char *name, u_long start, u_long end, int mtype, caddr_t storage,
if (flags & EX_NOCOALESCE)
ex->ex_flags |= EXF_NOCOALESCE;
+ if (flags & EX_FILLED) {
+ rp = extent_alloc_region_descriptor(ex, flags);
+ if (rp == NULL) {
+ if (!fixed_extent)
+ free(ex, mtype);
+ return (NULL);
+ }
+ rp->er_start = start;
+ rp->er_end = end;
+ LIST_INSERT_HEAD(&ex->ex_regions, rp, er_link);
+ }
+
#if defined(DIAGNOSTIC) || defined(DDB)
extent_register(ex);
#endif