diff options
author | Alex Reece <alex@delphix.com> | 2014-07-26 13:40:04 -0800 |
---|---|---|
committer | Christopher Siden <chris@delphix.com> | 2014-07-26 14:40:04 -0700 |
commit | 0f6d88aded0d165f5954688a9b13bac76c38da84 (patch) | |
tree | 7715c92e21aec1b3bec0d12880ffa5b2170f4807 /usr/src/common/avl/avl.c | |
parent | d690b62cf13675007342e6bb43d4816ec57a46dd (diff) | |
download | illumos-joyent-0f6d88aded0d165f5954688a9b13bac76c38da84.tar.gz |
4873 zvol unmap calls can take a very long time for larger datasets
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Basil Crow <basil.crow@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/common/avl/avl.c')
-rw-r--r-- | usr/src/common/avl/avl.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/usr/src/common/avl/avl.c b/usr/src/common/avl/avl.c index 4c0c213a10..4223da4991 100644 --- a/usr/src/common/avl/avl.c +++ b/usr/src/common/avl/avl.c @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + +/* * AVL - generic AVL tree implementation for kernel use * * A complete description of AVL trees can be found in many CS textbooks. @@ -85,6 +89,12 @@ * is a modified "avl_node_t *". The bottom bit (normally 0 for a * pointer) is set to indicate if that the new node has a value greater * than the value of the indicated "avl_node_t *". + * + * Note - in addition to userland (e.g. libavl and libutil) and the kernel + * (e.g. genunix), avl.c is compiled into ld.so and kmdb's genunix module, + * which each have their own compilation environments and subsequent + * requirements. Each of these environments must be considered when adding + * dependencies from avl.c. */ #include <sys/types.h> @@ -864,6 +874,24 @@ avl_update(avl_tree_t *t, void *obj) return (B_FALSE); } +void +avl_swap(avl_tree_t *tree1, avl_tree_t *tree2) +{ + avl_node_t *temp_node; + ulong_t temp_numnodes; + + ASSERT3P(tree1->avl_compar, ==, tree2->avl_compar); + ASSERT3U(tree1->avl_offset, ==, tree2->avl_offset); + ASSERT3U(tree1->avl_size, ==, tree2->avl_size); + + temp_node = tree1->avl_root; + temp_numnodes = tree1->avl_numnodes; + tree1->avl_root = tree2->avl_root; + tree1->avl_numnodes = tree2->avl_numnodes; + tree2->avl_root = temp_node; + tree2->avl_numnodes = temp_numnodes; +} + /* * initialize a new AVL tree */ |