diff options
author | eschrock <none@none> | 2007-04-19 17:36:51 -0700 |
---|---|---|
committer | eschrock <none@none> | 2007-04-19 17:36:51 -0700 |
commit | 68f944b71d3feda491e30f04cc360be6cdb79f21 (patch) | |
tree | 5a0f52b35a7779fef882fb879a83b3b82726fafd /usr/src/lib/libzfs/common/libzfs_config.c | |
parent | 815dd9170b31c7359f1b3fbe11df4da223766647 (diff) | |
download | illumos-gate-68f944b71d3feda491e30f04cc360be6cdb79f21.tar.gz |
6547185 libzfs should make use of uu_{list,avl}_teardown
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_config.c')
-rw-r--r-- | usr/src/lib/libzfs/common/libzfs_config.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_config.c b/usr/src/lib/libzfs/common/libzfs_config.c index 45e2920f3b..94640d1b12 100644 --- a/usr/src/lib/libzfs/common/libzfs_config.c +++ b/usr/src/lib/libzfs/common/libzfs_config.c @@ -74,22 +74,16 @@ void namespace_clear(libzfs_handle_t *hdl) { if (hdl->libzfs_ns_avl) { - uu_avl_walk_t *walk; config_node_t *cn; + void *cookie = NULL; - if ((walk = uu_avl_walk_start(hdl->libzfs_ns_avl, - UU_WALK_ROBUST)) == NULL) - return; - - while ((cn = uu_avl_walk_next(walk)) != NULL) { - uu_avl_remove(hdl->libzfs_ns_avl, cn); + while ((cn = uu_avl_teardown(hdl->libzfs_ns_avl, + &cookie)) != NULL) { nvlist_free(cn->cn_config); free(cn->cn_name); free(cn); } - uu_avl_walk_end(walk); - uu_avl_destroy(hdl->libzfs_ns_avl); hdl->libzfs_ns_avl = NULL; } @@ -110,7 +104,7 @@ namespace_reload(libzfs_handle_t *hdl) config_node_t *cn; nvpair_t *elem; zfs_cmd_t zc = { 0 }; - uu_avl_walk_t *walk; + void *cookie; if (hdl->libzfs_ns_gen == 0) { /* @@ -172,21 +166,13 @@ namespace_reload(libzfs_handle_t *hdl) /* * Clear out any existing configuration information. */ - if ((walk = uu_avl_walk_start(hdl->libzfs_ns_avl, - UU_WALK_ROBUST)) == NULL) { - nvlist_free(config); - return (no_memory(hdl)); - } - - while ((cn = uu_avl_walk_next(walk)) != NULL) { - uu_avl_remove(hdl->libzfs_ns_avl, cn); + cookie = NULL; + while ((cn = uu_avl_teardown(hdl->libzfs_ns_avl, &cookie)) != NULL) { nvlist_free(cn->cn_config); free(cn->cn_name); free(cn); } - uu_avl_walk_end(walk); - elem = NULL; while ((elem = nvlist_next_nvpair(config, elem)) != NULL) { nvlist_t *child; @@ -222,7 +208,7 @@ namespace_reload(libzfs_handle_t *hdl) } /* - * Retrive the configuration for the given pool. The configuration is a nvlist + * Retrieve the configuration for the given pool. The configuration is a nvlist * describing the vdevs, as well as the statistics associated with each one. */ nvlist_t * |