Merge commit 'refs/top-bases/linux-have-zvol' into linux-have-zvol

This commit is contained in:
Brian Behlendorf 2009-03-11 21:01:35 -07:00
commit 8d06511a29
9 changed files with 67 additions and 62 deletions

View File

@ -817,7 +817,7 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
static void static void
dump_bplist(objset_t *mos, uint64_t object, char *name) dump_bplist(objset_t *mos, uint64_t object, char *name)
{ {
bplist_t bpl = { 0 }; bplist_t bpl;
blkptr_t blk, *bp = &blk; blkptr_t blk, *bp = &blk;
uint64_t itor = 0; uint64_t itor = 0;
char bytes[6]; char bytes[6];
@ -827,6 +827,7 @@ dump_bplist(objset_t *mos, uint64_t object, char *name)
if (dump_opt['d'] < 3) if (dump_opt['d'] < 3)
return; return;
bzero(&bpl, sizeof(bplist_t));
mutex_init(&bpl.bpl_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&bpl.bpl_lock, NULL, MUTEX_DEFAULT, NULL);
VERIFY(0 == bplist_open(&bpl, mos, object)); VERIFY(0 == bplist_open(&bpl, mos, object));
if (bplist_empty(&bpl)) { if (bplist_empty(&bpl)) {
@ -1567,13 +1568,15 @@ zdb_blkptr_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb,
static int static int
dump_block_stats(spa_t *spa) dump_block_stats(spa_t *spa)
{ {
zdb_cb_t zcb = { 0 }; zdb_cb_t zcb;
zdb_blkstats_t *zb, *tzb; zdb_blkstats_t *zb, *tzb;
uint64_t alloc, space, logalloc; uint64_t alloc, space, logalloc;
vdev_t *rvd = spa->spa_root_vdev; vdev_t *rvd = spa->spa_root_vdev;
int leaks = 0; int leaks = 0;
int c, e; int c, e;
bzero(&zcb, sizeof(zdb_cb_t));
if (!dump_opt['S']) { if (!dump_opt['S']) {
(void) printf("\nTraversing all blocks %s%s%s%s...\n", (void) printf("\nTraversing all blocks %s%s%s%s...\n",
(dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "",

View File

@ -1932,11 +1932,12 @@ ztest_dmu_write_parallel(ztest_args_t *za)
pthread_mutex_t *lp; pthread_mutex_t *lp;
char osname[MAXNAMELEN]; char osname[MAXNAMELEN];
char iobuf[SPA_MAXBLOCKSIZE]; char iobuf[SPA_MAXBLOCKSIZE];
blkptr_t blk = { 0 }; blkptr_t blk;
uint64_t blkoff; uint64_t blkoff;
zbookmark_t zb; zbookmark_t zb;
dmu_tx_t *tx = dmu_tx_create(os); dmu_tx_t *tx = dmu_tx_create(os);
bzero(&blk, sizeof(blkptr_t));
dmu_objset_name(os, osname); dmu_objset_name(os, osname);
/* /*

View File

@ -103,7 +103,7 @@ namespace_reload(libzfs_handle_t *hdl)
nvlist_t *config; nvlist_t *config;
config_node_t *cn; config_node_t *cn;
nvpair_t *elem; nvpair_t *elem;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
void *cookie; void *cookie;
if (hdl->libzfs_ns_gen == 0) { if (hdl->libzfs_ns_gen == 0) {
@ -228,7 +228,7 @@ zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig)
int int
zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing) zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int error; int error;
nvlist_t *config; nvlist_t *config;
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;

View File

@ -368,7 +368,7 @@ static int
get_stats(zfs_handle_t *zhp) get_stats(zfs_handle_t *zhp)
{ {
int rc = 0; int rc = 0;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0) if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
return (-1); return (-1);
@ -415,7 +415,7 @@ top:
if (zhp->zfs_dmustats.dds_inconsistent) { if (zhp->zfs_dmustats.dds_inconsistent) {
zfs_cmd_t zc2 = { 0 }; zfs_cmd_t zc2 = { "\0", "\0", "\0", 0 };
/* /*
* If it is dds_inconsistent, then we've caught it in * If it is dds_inconsistent, then we've caught it in
@ -489,7 +489,7 @@ top:
zfs_handle_t * zfs_handle_t *
make_dataset_handle(libzfs_handle_t *hdl, const char *path) make_dataset_handle(libzfs_handle_t *hdl, const char *path)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
@ -1391,7 +1391,7 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms,
static int static int
zfs_perm_set_common(zfs_handle_t *zhp, nvlist_t *nvp, boolean_t unset) zfs_perm_set_common(zfs_handle_t *zhp, nvlist_t *nvp, boolean_t unset)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int error; int error;
char errbuf[1024]; char errbuf[1024];
@ -1605,7 +1605,7 @@ zfs_coalesce_perm(zfs_handle_t *zhp, zfs_allow_node_t *allownode,
int int
zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms) zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int error; int error;
nvlist_t *nvlist; nvlist_t *nvlist;
nvlist_t *permnv, *sourcenv; nvlist_t *permnv, *sourcenv;
@ -1943,7 +1943,7 @@ zfs_deleg_permissions(void)
int int
zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret = -1; int ret = -1;
prop_changelist_t *cl = NULL; prop_changelist_t *cl = NULL;
char errbuf[1024]; char errbuf[1024];
@ -2103,7 +2103,7 @@ error:
int int
zfs_prop_inherit(zfs_handle_t *zhp, const char *propname) zfs_prop_inherit(zfs_handle_t *zhp, const char *propname)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret; int ret;
prop_changelist_t *cl; prop_changelist_t *cl;
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
@ -2253,7 +2253,7 @@ static int
get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
char **source, uint64_t *val) char **source, uint64_t *val)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
nvlist_t *zplprops = NULL; nvlist_t *zplprops = NULL;
struct mnttab mnt; struct mnttab mnt;
char *mntopt_on = NULL; char *mntopt_on = NULL;
@ -2801,7 +2801,7 @@ top:
int int
zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zfs_handle_t *nzhp; zfs_handle_t *nzhp;
int ret; int ret;
@ -2843,7 +2843,7 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
int int
zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data) zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zfs_handle_t *nzhp; zfs_handle_t *nzhp;
int ret; int ret;
@ -2913,7 +2913,7 @@ static int
check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned, check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned,
boolean_t accept_ancestor, int *prefixlen) boolean_t accept_ancestor, int *prefixlen)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char parent[ZFS_MAXNAMELEN]; char parent[ZFS_MAXNAMELEN];
char *slash; char *slash;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -3118,7 +3118,7 @@ int
zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
nvlist_t *props) nvlist_t *props)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret; int ret;
uint64_t size = 0; uint64_t size = 0;
uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE);
@ -3281,7 +3281,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
int int
zfs_destroy(zfs_handle_t *zhp) zfs_destroy(zfs_handle_t *zhp)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
@ -3361,7 +3361,7 @@ zfs_remove_link_cb(zfs_handle_t *zhp, void *arg)
int int
zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname) zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret; int ret;
struct destroydata dd = { 0 }; struct destroydata dd = { 0 };
@ -3405,7 +3405,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname)
int int
zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props) zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char parent[ZFS_MAXNAMELEN]; char parent[ZFS_MAXNAMELEN];
int ret; int ret;
char errbuf[1024]; char errbuf[1024];
@ -3554,7 +3554,7 @@ int
zfs_promote(zfs_handle_t *zhp) zfs_promote(zfs_handle_t *zhp)
{ {
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char parent[MAXPATHLEN]; char parent[MAXPATHLEN];
char *cp; char *cp;
int ret; int ret;
@ -3677,7 +3677,7 @@ zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive,
const char *delim; const char *delim;
char parent[ZFS_MAXNAMELEN]; char parent[ZFS_MAXNAMELEN];
zfs_handle_t *zhp; zfs_handle_t *zhp;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret; int ret;
char errbuf[1024]; char errbuf[1024];
@ -3829,7 +3829,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
{ {
rollback_data_t cb = { 0 }; rollback_data_t cb = { 0 };
int err; int err;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
boolean_t restore_resv = 0; boolean_t restore_resv = 0;
uint64_t old_volsize = 0, new_volsize; uint64_t old_volsize = 0, new_volsize;
zfs_prop_t resv_prop; zfs_prop_t resv_prop;
@ -3951,7 +3951,7 @@ int
zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive) zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
{ {
int ret; int ret;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char *delim; char *delim;
prop_changelist_t *cl = NULL; prop_changelist_t *cl = NULL;
zfs_handle_t *zhrp = NULL; zfs_handle_t *zhrp = NULL;
@ -4275,7 +4275,7 @@ zvol_create_link_common(libzfs_handle_t *hdl, const char *dataset, int ifexists)
int int
zvol_remove_link(libzfs_handle_t *hdl, const char *dataset) zvol_remove_link(libzfs_handle_t *hdl, const char *dataset)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
(void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
@ -4454,7 +4454,7 @@ int
zfs_deleg_share_nfs(libzfs_handle_t *hdl, char *dataset, char *path, zfs_deleg_share_nfs(libzfs_handle_t *hdl, char *dataset, char *path,
void *export, void *sharetab, int sharemax, zfs_share_op_t operation) void *export, void *sharetab, int sharemax, zfs_share_op_t operation)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int error; int error;
(void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));

View File

@ -381,7 +381,7 @@ zfs_graph_add(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *source,
static int static int
iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zfs_vertex_t *zvp; zfs_vertex_t *zvp;
/* /*
@ -482,7 +482,7 @@ iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
static boolean_t static boolean_t
external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
/* /*
* Check whether this dataset is a clone or has clones since * Check whether this dataset is a clone or has clones since

View File

@ -367,7 +367,7 @@ static nvlist_t *
refresh_config(libzfs_handle_t *hdl, nvlist_t *config) refresh_config(libzfs_handle_t *hdl, nvlist_t *config)
{ {
nvlist_t *nvl; nvlist_t *nvl;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int err; int err;
if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0)

View File

@ -64,7 +64,7 @@ static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
static int static int
zpool_get_all_props(zpool_handle_t *zhp) zpool_get_all_props(zpool_handle_t *zhp)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
@ -548,7 +548,7 @@ error:
int int
zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval) zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret = -1; int ret = -1;
char errbuf[1024]; char errbuf[1024];
nvlist_t *nvl = NULL; nvlist_t *nvl = NULL;
@ -853,7 +853,7 @@ int
zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot, zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
nvlist_t *props, nvlist_t *fsprops) nvlist_t *props, nvlist_t *fsprops)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
nvlist_t *zc_fsprops = NULL; nvlist_t *zc_fsprops = NULL;
nvlist_t *zc_props = NULL; nvlist_t *zc_props = NULL;
char msg[1024]; char msg[1024];
@ -983,7 +983,7 @@ create_failed:
int int
zpool_destroy(zpool_handle_t *zhp) zpool_destroy(zpool_handle_t *zhp)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zfs_handle_t *zfp = NULL; zfs_handle_t *zfp = NULL;
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
char msg[1024]; char msg[1024];
@ -1030,7 +1030,7 @@ zpool_destroy(zpool_handle_t *zhp)
int int
zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot) zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int ret; int ret;
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
char msg[1024]; char msg[1024];
@ -1153,7 +1153,7 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
int int
zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce) zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
if (zpool_remove_zvol_links(zhp) != 0) if (zpool_remove_zvol_links(zhp) != 0)
@ -1245,7 +1245,7 @@ int
zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
nvlist_t *props, boolean_t importfaulted) nvlist_t *props, boolean_t importfaulted)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char *thename; char *thename;
char *origname; char *origname;
int ret; int ret;
@ -1349,7 +1349,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
int int
zpool_scrub(zpool_handle_t *zhp, pool_scrub_type_t type) zpool_scrub(zpool_handle_t *zhp, pool_scrub_type_t type)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -1614,7 +1614,7 @@ int
zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags, zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
vdev_state_t *newstate) vdev_state_t *newstate)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -1650,7 +1650,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
int int
zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp) zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -1695,7 +1695,7 @@ zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp)
int int
zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid) zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -1729,7 +1729,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid)
int int
zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid) zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -1782,7 +1782,7 @@ int
zpool_vdev_attach(zpool_handle_t *zhp, zpool_vdev_attach(zpool_handle_t *zhp,
const char *old_disk, const char *new_disk, nvlist_t *nvroot, int replacing) const char *old_disk, const char *new_disk, nvlist_t *nvroot, int replacing)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
int ret; int ret;
nvlist_t *tgt; nvlist_t *tgt;
@ -1965,7 +1965,7 @@ zpool_vdev_attach(zpool_handle_t *zhp,
int int
zpool_vdev_detach(zpool_handle_t *zhp, const char *path) zpool_vdev_detach(zpool_handle_t *zhp, const char *path)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -2022,7 +2022,7 @@ zpool_vdev_detach(zpool_handle_t *zhp, const char *path)
int int
zpool_vdev_remove(zpool_handle_t *zhp, const char *path) zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -2057,7 +2057,7 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
int int
zpool_clear(zpool_handle_t *zhp, const char *path) zpool_clear(zpool_handle_t *zhp, const char *path)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -2101,7 +2101,7 @@ zpool_clear(zpool_handle_t *zhp, const char *path)
int int
zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid) zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -2353,7 +2353,7 @@ path_to_devid(const char *path)
static void static void
set_path(zpool_handle_t *zhp, nvlist_t *nv, const char *path) set_path(zpool_handle_t *zhp, nvlist_t *nv, const char *path)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
(void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
(void) strncpy(zc.zc_value, path, sizeof (zc.zc_value)); (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value));
@ -2476,7 +2476,7 @@ zbookmark_compare(const void *a, const void *b)
int int
zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
uint64_t count; uint64_t count;
zbookmark_t *zb = NULL; zbookmark_t *zb = NULL;
int i; int i;
@ -2572,7 +2572,7 @@ nomem:
int int
zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version) zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
(void) strcpy(zc.zc_name, zhp->zpool_name); (void) strcpy(zc.zc_name, zhp->zpool_name);
@ -2634,7 +2634,7 @@ zpool_stage_history(libzfs_handle_t *hdl, const char *history_str)
static int static int
get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len) get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
@ -2761,7 +2761,7 @@ void
zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj, zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
char *pathname, size_t len) char *pathname, size_t len)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
boolean_t mounted = B_FALSE; boolean_t mounted = B_FALSE;
char *mntpnt = NULL; char *mntpnt = NULL;
char dsname[MAXNAMELEN]; char dsname[MAXNAMELEN];

View File

@ -451,7 +451,7 @@ static int
dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, boolean_t fromorigin, dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, boolean_t fromorigin,
int outfd) int outfd)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
@ -552,7 +552,7 @@ dump_filesystem(zfs_handle_t *zhp, void *arg)
int rv = 0; int rv = 0;
send_dump_data_t *sdd = arg; send_dump_data_t *sdd = arg;
boolean_t missingfrom = B_FALSE; boolean_t missingfrom = B_FALSE;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
(void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s", (void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s",
zhp->zfs_name, sdd->tosnap); zhp->zfs_name, sdd->tosnap);
@ -709,7 +709,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
dmu_replay_record_t drr = { 0 }; dmu_replay_record_t drr = { 0 };
char *packbuf = NULL; char *packbuf = NULL;
size_t buflen = 0; size_t buflen = 0;
zio_cksum_t zc = { 0 }; zio_cksum_t zc = { { 0 } };
assert(fromsnap || doall); assert(fromsnap || doall);
@ -875,7 +875,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
int baselen, char *newname, recvflags_t flags) int baselen, char *newname, recvflags_t flags)
{ {
static int seq; static int seq;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int err; int err;
prop_changelist_t *clp; prop_changelist_t *clp;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -947,7 +947,7 @@ static int
recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen, recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
char *newname, recvflags_t flags) char *newname, recvflags_t flags)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
int err = 0; int err = 0;
prop_changelist_t *clp; prop_changelist_t *clp;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -1158,7 +1158,7 @@ again:
stream_originguid, originguid)) { stream_originguid, originguid)) {
case 1: { case 1: {
/* promote it! */ /* promote it! */
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
nvlist_t *origin_nvfs; nvlist_t *origin_nvfs;
char *origin_fsname; char *origin_fsname;
@ -1230,7 +1230,7 @@ again:
if (0 == nvlist_lookup_nvlist(stream_nvfs, "snapprops", if (0 == nvlist_lookup_nvlist(stream_nvfs, "snapprops",
&props) && 0 == nvlist_lookup_nvlist(props, &props) && 0 == nvlist_lookup_nvlist(props,
stream_snapname, &props)) { stream_snapname, &props)) {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
zc.zc_cookie = B_TRUE; /* clear current props */ zc.zc_cookie = B_TRUE; /* clear current props */
(void) snprintf(zc.zc_name, sizeof (zc.zc_name), (void) snprintf(zc.zc_name, sizeof (zc.zc_name),
@ -1556,7 +1556,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
dmu_replay_record_t *drr_noswap, avl_tree_t *stream_avl, dmu_replay_record_t *drr_noswap, avl_tree_t *stream_avl,
char **top_zfs) char **top_zfs)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
time_t begin_time; time_t begin_time;
int ioctl_err, ioctl_errno, err, choplen; int ioctl_err, ioctl_errno, err, choplen;
char *cp; char *cp;
@ -1835,7 +1835,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
zcmd_free_nvlists(&zc); zcmd_free_nvlists(&zc);
if (err == 0 && snapprops_nvlist) { if (err == 0 && snapprops_nvlist) {
zfs_cmd_t zc2 = { 0 }; zfs_cmd_t zc2 = { "\0", "\0", "\0", 0 };
(void) strcpy(zc2.zc_name, zc.zc_value); (void) strcpy(zc2.zc_name, zc.zc_value);
if (zcmd_write_src_nvlist(hdl, &zc2, snapprops_nvlist) == 0) { if (zcmd_write_src_nvlist(hdl, &zc2, snapprops_nvlist) == 0) {
@ -1990,7 +1990,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
dmu_replay_record_t drr, drr_noswap; dmu_replay_record_t drr, drr_noswap;
struct drr_begin *drrb = &drr.drr_u.drr_begin; struct drr_begin *drrb = &drr.drr_u.drr_begin;
char errbuf[1024]; char errbuf[1024];
zio_cksum_t zcksum = { 0 }; zio_cksum_t zcksum = { { 0 } };
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot receive")); "cannot receive"));

View File

@ -2614,10 +2614,11 @@ dsl_dataset_promote(const char *name)
dsl_dir_t *dd; dsl_dir_t *dd;
dsl_pool_t *dp; dsl_pool_t *dp;
dmu_object_info_t doi; dmu_object_info_t doi;
struct promotearg pa = { 0 }; struct promotearg pa;
struct promotenode *snap; struct promotenode *snap;
int err; int err;
bzero(&pa, sizeof(struct promotearg));
err = dsl_dataset_hold(name, FTAG, &ds); err = dsl_dataset_hold(name, FTAG, &ds);
if (err) if (err)
return (err); return (err);