diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-04-19 15:26:53 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-04-19 15:26:53 +0000 |
commit | 43dfa343205f93e307354f2eb9bb65eee19711ed (patch) | |
tree | b9bc3b266acef6eed57c4345a94802633e9968cb /sys/kern | |
parent | 9781289811c33accd41427618263b031a443438a (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.c | 14 |
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 |