aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_radix.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2013-08-23 17:27:12 +0000
committerAlan Cox <alc@FreeBSD.org>2013-08-23 17:27:12 +0000
commit776cad90ffd4d58695d87a2f920e5f017cb14565 (patch)
treeb3d35fed9a216baba77d1d4ee4e085d1772299e9 /sys/vm/vm_radix.c
parentd23db150208361f11994a54c7522fe62e0374423 (diff)
downloadsrc-776cad90ffd4d58695d87a2f920e5f017cb14565.tar.gz
src-776cad90ffd4d58695d87a2f920e5f017cb14565.zip
Notes
Diffstat (limited to 'sys/vm/vm_radix.c')
-rw-r--r--sys/vm/vm_radix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c
index 8698738c8503..ff311b2d5b55 100644
--- a/sys/vm/vm_radix.c
+++ b/sys/vm/vm_radix.c
@@ -432,6 +432,21 @@ restart:
}
/*
+ * Returns TRUE if the specified radix tree contains a single leaf and FALSE
+ * otherwise.
+ */
+boolean_t
+vm_radix_is_singleton(struct vm_radix *rtree)
+{
+ struct vm_radix_node *rnode;
+
+ rnode = vm_radix_getroot(rtree);
+ if (rnode == NULL)
+ return (FALSE);
+ return (vm_radix_isleaf(rnode));
+}
+
+/*
* Returns the value stored at the index. If the index is not present,
* NULL is returned.
*/