diff options
author | pjd <pjd@FreeBSD.org> | 2007-04-21 12:02:57 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-04-21 12:02:57 +0000 |
commit | 24d44898020531c24ba8914b294876e52f304e4f (patch) | |
tree | 932d85fefa7fcb86834f441607b2a4438d5b0c0f /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c | |
parent | e60ce7e12076f27ac5471441a6940e2254378506 (diff) | |
download | FreeBSD-src-24d44898020531c24ba8914b294876e52f304e4f.zip FreeBSD-src-24d44898020531c24ba8914b294876e52f304e4f.tar.gz |
MFp4:
@118370 Correct typo.
@118371 Integrate changes from vendor.
@118491 Show backtrace on unexpected code paths.
@118494 Integrate changes from vendor.
@118504 Fix sendfile(2). I had two ways of fixing it:
1. Fixing sendfile(2) itself to use VOP_GETPAGES() instead of
hacking around with vn_rdwr(UIO_NOCOPY), which was suggested
by ups.
2. Modify ZFS behaviour to handle this special case.
Although 1 is more correct, I've choosen 2, because hack from 1
have a side-effect of beeing faster - it reads ahead MAXBSIZE
bytes instead of reading page by page. This is not easy to implement
with VOP_GETPAGES(), at least not for me in this very moment.
Reported by: Andrey V. Elsukov <bu7cher@yandex.ru>
@118525 Reorganize the code to reduce diff.
@118526 This code path is expected. It is simply when file is opened with
O_FSYNC flag.
Reported by: kris
Reported by: Michal Suszko <dry@dry.pl>
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c index 45e2920..94640d1 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c +++ b/cddl/contrib/opensolaris/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 * |