summaryrefslogtreecommitdiffstats
path: root/cddl/contrib
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-04-21 12:02:57 +0000
committerpjd <pjd@FreeBSD.org>2007-04-21 12:02:57 +0000
commit24d44898020531c24ba8914b294876e52f304e4f (patch)
tree932d85fefa7fcb86834f441607b2a4438d5b0c0f /cddl/contrib
parente60ce7e12076f27ac5471441a6940e2254378506 (diff)
downloadFreeBSD-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')
-rw-r--r--cddl/contrib/opensolaris/cmd/zdb/zdb.c12
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c15
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c28
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c4
4 files changed, 18 insertions, 41 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
index bb7a52e..03abc3a 100644
--- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c
+++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
@@ -932,11 +932,11 @@ dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6)
(void) snprintf(aux + strlen(aux), sizeof (aux), " (K=%s)",
- zio_checksum_table[doi.doi_checksum].ci_name);
+ zio_checksum_table[doi.doi_checksum].ci_name);
if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6)
(void) snprintf(aux + strlen(aux), sizeof (aux), " (Z=%s)",
- zio_compress_table[doi.doi_compress].ci_name);
+ zio_compress_table[doi.doi_compress].ci_name);
(void) printf("%10lld %3u %5s %5s %5s %5s %s%s\n",
(u_longlong_t)object, doi.doi_indirection, iblk, dblk, lsize,
@@ -1441,7 +1441,7 @@ zdb_blkptr_cb(traverse_blk_cache_t *bc, spa_t *spa, void *arg)
(u_longlong_t)zb->zb_objset,
(u_longlong_t)zb->zb_object,
(u_longlong_t)blkid2offset(bc->bc_dnode,
- zb->zb_level, zb->zb_blkid),
+ zb->zb_level, zb->zb_blkid),
blkbuf);
}
@@ -1951,8 +1951,8 @@ zdb_read_block(char *thing, spa_t **spap)
spa_close(spa, (void *)zdb_read_block);
error = spa_open(spa_name, spap, (void *)zdb_read_block);
if (error)
- fatal("Failed to open pool '%s': errno = %d\n",
- spa_name, error);
+ fatal("Failed to open pool '%s': %s",
+ spa_name, strerror(error));
spa = *spap;
}
@@ -2156,7 +2156,7 @@ main(int argc, char **argv)
}
if (error)
- fatal("can't open %s: error %d", argv[0], error);
+ fatal("can't open %s: %s", argv[0], strerror(error));
argv++;
if (--argc > 0) {
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
index d68c420..5e6de6d 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
@@ -339,22 +339,15 @@ void
changelist_free(prop_changelist_t *clp)
{
prop_changenode_t *cn;
- uu_list_walk_t *walk;
+ void *cookie;
if (clp->cl_list) {
- verify((walk = uu_list_walk_start(clp->cl_list,
- UU_WALK_ROBUST)) != NULL);
-
- while ((cn = uu_list_walk_next(walk)) != NULL) {
-
- uu_list_remove(clp->cl_list, cn);
-
+ cookie = NULL;
+ while ((cn = uu_list_teardown(clp->cl_list, &cookie)) != NULL) {
zfs_close(cn->cn_handle);
free(cn);
}
- uu_list_walk_end(walk);
-
uu_list_destroy(clp->cl_list);
}
if (clp->cl_pool)
@@ -418,7 +411,7 @@ change_one(zfs_handle_t *zhp, void *data)
} else {
ASSERT(!clp->cl_alldependents);
verify(uu_list_insert_before(clp->cl_list,
- uu_list_first(clp->cl_list), cn) == 0);
+ uu_list_first(clp->cl_list), cn) == 0);
}
if (!clp->cl_alldependents)
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 *
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
index 26d15e9..1c77045 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
@@ -220,7 +220,7 @@ add_config(libzfs_handle_t *hdl, pool_list_t *pl, const char *path,
&state) == 0 && state == POOL_STATE_SPARE &&
nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, &vdev_guid) == 0) {
if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL)
- return (-1);
+ return (-1);
if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) {
free(ne);
@@ -748,7 +748,6 @@ nvlist_t *
zpool_find_import(libzfs_handle_t *hdl, int argc, char **argv)
{
int i;
- DIR *dirp;
char path[MAXPATHLEN];
nvlist_t *ret = NULL, *config;
int fd;
@@ -824,7 +823,6 @@ error:
free(ne);
}
-
return (ret);
}
OpenPOWER on IntegriCloud