summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-02-23 19:58:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-02-23 19:58:49 +0000
commit2161d27806dee4f94bb3707c6364ab1fd3d94973 (patch)
treeccf2af058a44e9bea5aa2e6fcc6fbf6e08a32737 /sys
parent673db3e23df44b85700b1c291bbb9e87d11d4b97 (diff)
Remove unused extent_find(). Then, we can keep the extent list only if
option DIAGNOSTIC || option DDB, saves some room on installation media.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_extent.c28
-rw-r--r--sys/sys/extent.h3
2 files changed, 7 insertions, 24 deletions
diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c
index b70836cff40..41a4d4e24b0 100644
--- a/sys/kern/subr_extent.c
+++ b/sys/kern/subr_extent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_extent.c,v 1.30 2005/12/09 09:09:52 jsg Exp $ */
+/* $OpenBSD: subr_extent.c,v 1.31 2006/02/23 19:58:47 miod Exp $ */
/* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */
/*-
@@ -80,7 +80,6 @@ static void extent_insert_and_optimize(struct extent *, u_long, u_long,
static struct extent_region *extent_alloc_region_descriptor(struct extent *, int);
static void extent_free_region_descriptor(struct extent *,
struct extent_region *);
-static void extent_register(struct extent *);
/*
* Macro to align to an arbitrary power-of-two boundary.
@@ -89,11 +88,13 @@ static void extent_register(struct extent *);
(((((_start) - (_skew)) + ((_align) - 1)) & (-(_align))) + (_skew))
+#if defined(DIAGNOSTIC) || defined(DDB)
/*
* Register the extent on a doubly linked list.
* Should work, no?
*/
static LIST_HEAD(listhead, extent) ext_list;
+static void extent_register(struct extent *);
static void
extent_register(struct extent *ex)
@@ -118,6 +119,7 @@ extent_register(struct extent *ex)
/* Insert into list */
LIST_INSERT_HEAD(&ext_list, ex, ex_link);
}
+#endif /* DIAGNOSTIC || DDB */
struct pool ex_region_pl;
@@ -133,26 +135,6 @@ extent_pool_init(void)
}
}
-/*
- * Find a given extent, and return a pointer to
- * it so that other extent functions can be used
- * on it.
- *
- * Returns NULL on failure.
- */
-struct extent *
-extent_find(char *name)
-{
- struct extent *ep;
-
- LIST_FOREACH(ep, &ext_list, ex_link) {
- if (!strcmp(ep->ex_name, name))
- return(ep);
- }
-
- return(NULL);
-}
-
#ifdef DDB
/*
* Print out all extents registered. This is used in
@@ -246,7 +228,9 @@ 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 defined(DIAGNOSTIC) || defined(DDB)
extent_register(ex);
+#endif
return (ex);
}
diff --git a/sys/sys/extent.h b/sys/sys/extent.h
index fd4fb374fdf..aff33bd0392 100644
--- a/sys/sys/extent.h
+++ b/sys/sys/extent.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extent.h,v 1.7 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: extent.h,v 1.8 2006/02/23 19:58:48 miod Exp $ */
/* $NetBSD: extent.h,v 1.6 1997/10/09 07:43:05 jtc Exp $ */
/*-
@@ -103,7 +103,6 @@ struct extent_fixed {
((ALIGN(sizeof(struct extent_region))) * \
(_nregions)))
-struct extent *extent_find(char *);
void extent_print_all(void);
struct extent *extent_create(char *, u_long, u_long, int,