Fix gcc missing braces warnings

Resolve compiler warnings concerning missing braces.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2010-08-26 09:52:41 -07:00
parent 0bc8fd7884
commit 2598c0012d
11 changed files with 80 additions and 72 deletions

View File

@ -2179,7 +2179,7 @@ count_block_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
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 norm_alloc, norm_space, total_alloc, total_found; uint64_t norm_alloc, norm_space, total_alloc, total_found;
int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD;
@ -2201,6 +2201,7 @@ dump_block_stats(spa_t *spa)
* it's not part of any space map) is a double allocation, * it's not part of any space map) is a double allocation,
* reference to a freed block, or an unclaimed log block. * reference to a freed block, or an unclaimed log block.
*/ */
bzero(&zcb, sizeof(zdb_cb_t));
zdb_leak_init(spa, &zcb); zdb_leak_init(spa, &zcb);
/* /*
@ -2413,8 +2414,11 @@ dump_simulated_ddt(spa_t *spa)
avl_tree_t t; avl_tree_t t;
void *cookie = NULL; void *cookie = NULL;
zdb_ddt_entry_t *zdde; zdb_ddt_entry_t *zdde;
ddt_histogram_t ddh_total = { 0 }; ddt_histogram_t ddh_total;
ddt_stat_t dds_total = { 0 }; ddt_stat_t dds_total;
bzero(&ddh_total, sizeof (ddt_histogram_t));
bzero(&dds_total, sizeof (ddt_stat_t));
avl_create(&t, ddt_entry_compare, avl_create(&t, ddt_entry_compare,
sizeof (zdb_ddt_entry_t), offsetof(zdb_ddt_entry_t, zdde_node)); sizeof (zdb_ddt_entry_t), offsetof(zdb_ddt_entry_t, zdde_node));

View File

@ -101,7 +101,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", 0 };
void *cookie; void *cookie;
if (hdl->libzfs_ns_gen == 0) { if (hdl->libzfs_ns_gen == 0) {
@ -226,7 +226,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", 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

@ -344,7 +344,7 @@ get_recvd_props_ioctl(zfs_handle_t *zhp)
{ {
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
nvlist_t *recvdprops; nvlist_t *recvdprops;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
int err; int err;
if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0) if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0)
@ -407,7 +407,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", 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);
@ -467,7 +467,7 @@ make_dataset_handle_common(zfs_handle_t *zhp, zfs_cmd_t *zc)
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", 0 };
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
@ -1343,7 +1343,7 @@ zfs_setprop_error(libzfs_handle_t *hdl, zfs_prop_t prop, int err,
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", 0 };
int ret = -1; int ret = -1;
prop_changelist_t *cl = NULL; prop_changelist_t *cl = NULL;
char errbuf[1024]; char errbuf[1024];
@ -1455,7 +1455,7 @@ error:
int int
zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received) zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\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;
@ -1630,7 +1630,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", 0 };
nvlist_t *zplprops = NULL; nvlist_t *zplprops = NULL;
struct mnttab mnt; struct mnttab mnt;
char *mntopt_on = NULL; char *mntopt_on = NULL;
@ -2347,7 +2347,7 @@ zfs_prop_get_userquota_common(zfs_handle_t *zhp, const char *propname,
uint64_t *propvalue, zfs_userquota_prop_t *typep) uint64_t *propvalue, zfs_userquota_prop_t *typep)
{ {
int err; int err;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
(void) strncpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); (void) strncpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
@ -2466,7 +2466,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", 0 };
zfs_handle_t *nzhp; zfs_handle_t *nzhp;
int ret; int ret;
@ -2502,7 +2502,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", 0 };
zfs_handle_t *nzhp; zfs_handle_t *nzhp;
int ret; int ret;
@ -2593,7 +2593,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", 0 };
char parent[ZFS_MAXNAMELEN]; char parent[ZFS_MAXNAMELEN];
char *slash; char *slash;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -2801,7 +2801,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", 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);
@ -2952,7 +2952,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
int int
zfs_destroy(zfs_handle_t *zhp, boolean_t defer) zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\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));
@ -3013,7 +3013,7 @@ zfs_check_snap_cb(zfs_handle_t *zhp, void *arg)
int int
zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer) zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
int ret; int ret;
struct destroydata dd = { 0 }; struct destroydata dd = { 0 };
@ -3058,7 +3058,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer)
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", 0 };
char parent[ZFS_MAXNAMELEN]; char parent[ZFS_MAXNAMELEN];
int ret; int ret;
char errbuf[1024]; char errbuf[1024];
@ -3148,7 +3148,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", 0 };
char parent[MAXPATHLEN]; char parent[MAXPATHLEN];
int ret; int ret;
char errbuf[1024]; char errbuf[1024];
@ -3202,7 +3202,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", 0 };
int ret; int ret;
char errbuf[1024]; char errbuf[1024];
@ -3334,7 +3334,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", 0 };
boolean_t restore_resv = 0; boolean_t restore_resv = 0;
uint64_t old_volsize, new_volsize; uint64_t old_volsize, new_volsize;
zfs_prop_t resv_prop; zfs_prop_t resv_prop;
@ -3450,7 +3450,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", 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;
@ -3756,7 +3756,7 @@ zfs_deleg_share_nfs(libzfs_handle_t *hdl, char *dataset, char *path,
char *resource, void *export, void *sharetab, char *resource, void *export, void *sharetab,
int sharemax, zfs_share_op_t operation) int sharemax, zfs_share_op_t operation)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\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));
@ -3806,7 +3806,7 @@ static int
zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path, zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path,
zfs_smb_acl_op_t cmd, char *resource1, char *resource2) zfs_smb_acl_op_t cmd, char *resource1, char *resource2)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
nvlist_t *nvlist = NULL; nvlist_t *nvlist = NULL;
int error; int error;
@ -3888,7 +3888,7 @@ int
zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type, zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
zfs_userspace_cb_t func, void *arg) zfs_userspace_cb_t func, void *arg)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
int error; int error;
zfs_useracct_t buf[100]; zfs_useracct_t buf[100];
@ -3925,7 +3925,7 @@ zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag,
boolean_t recursive, boolean_t temphold, boolean_t enoent_ok, boolean_t recursive, boolean_t temphold, boolean_t enoent_ok,
int cleanup_fd, uint64_t dsobj, uint64_t createtxg) int cleanup_fd, uint64_t dsobj, uint64_t createtxg)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
ASSERT(!recursive || dsobj == 0); ASSERT(!recursive || dsobj == 0);
@ -3983,7 +3983,7 @@ int
zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag, zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag,
boolean_t recursive) boolean_t recursive)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));

View File

@ -90,7 +90,7 @@ static int
get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj, get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj,
char *pn, int maxlen, zfs_stat_t *sb) char *pn, int maxlen, zfs_stat_t *sb)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
int error; int error;
(void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name));
@ -375,7 +375,7 @@ describe_free(FILE *fp, differ_info_t *di, uint64_t object, char *namebuf,
static int static int
write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff_record_t *dr) write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff_record_t *dr)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
libzfs_handle_t *lhdl = di->zhp->zfs_hdl; libzfs_handle_t *lhdl = di->zhp->zfs_hdl;
char fobjname[MAXPATHLEN]; char fobjname[MAXPATHLEN];
@ -503,7 +503,7 @@ static int
make_temp_snapshot(differ_info_t *di) make_temp_snapshot(differ_info_t *di)
{ {
libzfs_handle_t *hdl = di->zhp->zfs_hdl; libzfs_handle_t *hdl = di->zhp->zfs_hdl;
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
(void) snprintf(zc.zc_value, sizeof (zc.zc_value), (void) snprintf(zc.zc_value, sizeof (zc.zc_value),
ZDIFF_PREFIX, getpid()); ZDIFF_PREFIX, getpid());
@ -745,7 +745,7 @@ int
zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap, zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
const char *tosnap, int flags) const char *tosnap, int flags)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char errbuf[1024]; char errbuf[1024];
differ_info_t di = { 0 }; differ_info_t di = { 0 };
pthread_t tid; pthread_t tid;

View File

@ -379,7 +379,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", 0 };
zfs_vertex_t *zvp; zfs_vertex_t *zvp;
/* /*
@ -473,7 +473,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", 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

@ -370,7 +370,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", 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

@ -62,7 +62,7 @@ typedef struct prop_flags {
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", 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));
@ -565,7 +565,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", 0 };
int ret = -1; int ret = -1;
char errbuf[1024]; char errbuf[1024];
nvlist_t *nvl = NULL; nvlist_t *nvl = NULL;
@ -877,7 +877,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", 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];
@ -1009,7 +1009,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", 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];
@ -1052,7 +1052,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", 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];
@ -1176,7 +1176,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", 0 };
char msg[1024]; char msg[1024];
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
@ -1422,7 +1422,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, int flags) nvlist_t *props, int flags)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
zpool_rewind_policy_t policy; zpool_rewind_policy_t policy;
nvlist_t *nv = NULL; nvlist_t *nv = NULL;
nvlist_t *nvinfo = NULL; nvlist_t *nvinfo = NULL;
@ -1592,7 +1592,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
int int
zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func) zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -2136,7 +2136,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", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache, islog; boolean_t avail_spare, l2cache, islog;
@ -2208,7 +2208,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", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -2258,7 +2258,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, vdev_aux_t aux) zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -2293,7 +2293,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
int int
zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux) zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -2347,7 +2347,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", 0 };
char msg[1024]; char msg[1024];
int ret; int ret;
nvlist_t *tgt; nvlist_t *tgt;
@ -2521,7 +2521,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", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache; boolean_t avail_spare, l2cache;
@ -2619,7 +2619,7 @@ int
zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot, zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
nvlist_t *props, splitflags_t flags) nvlist_t *props, splitflags_t flags)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL; nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL;
nvlist_t **varray = NULL, *zc_props = NULL; nvlist_t **varray = NULL, *zc_props = NULL;
@ -2830,7 +2830,7 @@ out:
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", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
boolean_t avail_spare, l2cache, islog; boolean_t avail_spare, l2cache, islog;
@ -2875,7 +2875,7 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
int int
zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl) zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
char msg[1024]; char msg[1024];
nvlist_t *tgt; nvlist_t *tgt;
zpool_rewind_policy_t policy; zpool_rewind_policy_t policy;
@ -2951,7 +2951,7 @@ zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl)
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", 0 };
char msg[1024]; char msg[1024];
libzfs_handle_t *hdl = zhp->zpool_hdl; libzfs_handle_t *hdl = zhp->zpool_hdl;
@ -3035,7 +3035,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", 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));
@ -3186,7 +3186,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", 0 };
uint64_t count; uint64_t count;
zbookmark_t *zb = NULL; zbookmark_t *zb = NULL;
int i; int i;
@ -3282,7 +3282,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", 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);
@ -3344,7 +3344,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", 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));
@ -3471,7 +3471,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", 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

@ -53,7 +53,7 @@ extern void zfs_setprop_error(libzfs_handle_t *, zfs_prop_t, int, char *);
static int zfs_receive_impl(libzfs_handle_t *, const char *, recvflags_t, static int zfs_receive_impl(libzfs_handle_t *, const char *, recvflags_t,
int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *); int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *);
static const zio_cksum_t zero_cksum = { 0 }; static const zio_cksum_t zero_cksum = { { 0 } };
typedef struct dedup_arg { typedef struct dedup_arg {
int inputfd; int inputfd;
@ -882,7 +882,7 @@ static int
dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj, dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
boolean_t fromorigin, int outfd, nvlist_t *debugnv) boolean_t fromorigin, int outfd, nvlist_t *debugnv)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
nvlist_t *thisdbg; nvlist_t *thisdbg;
@ -1096,7 +1096,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", 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);
@ -1318,7 +1318,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 } };
if (flags.replicate || flags.props) { if (flags.replicate || flags.props) {
nvlist_t *hdrnv; nvlist_t *hdrnv;
@ -1530,7 +1530,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", 0 };
int err; int err;
prop_changelist_t *clp; prop_changelist_t *clp;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -1603,7 +1603,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", 0 };
int err = 0; int err = 0;
prop_changelist_t *clp; prop_changelist_t *clp;
zfs_handle_t *zhp; zfs_handle_t *zhp;
@ -1831,7 +1831,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", 0 };
nvlist_t *origin_nvfs; nvlist_t *origin_nvfs;
char *origin_fsname; char *origin_fsname;
@ -1903,7 +1903,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", 0 };
zc.zc_cookie = B_TRUE; /* received */ zc.zc_cookie = B_TRUE; /* received */
(void) snprintf(zc.zc_name, sizeof (zc.zc_name), (void) snprintf(zc.zc_name, sizeof (zc.zc_name),
@ -2334,7 +2334,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd,
uint64_t *action_handlep) uint64_t *action_handlep)
{ {
zfs_cmd_t zc = { 0 }; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
time_t begin_time; time_t begin_time;
int ioctl_err, ioctl_errno, err; int ioctl_err, ioctl_errno, err;
char *cp; char *cp;
@ -2702,7 +2702,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", 0 };
(void) strcpy(zc2.zc_name, zc.zc_value); (void) strcpy(zc2.zc_name, zc.zc_value);
zc2.zc_cookie = B_TRUE; /* received */ zc2.zc_cookie = B_TRUE; /* received */
@ -2877,7 +2877,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 } };
uint64_t featureflags; uint64_t featureflags;
int hdrtype; int hdrtype;

View File

@ -1745,13 +1745,14 @@ static void
arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes) arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes)
{ {
arc_buf_hdr_t *ab, *ab_prev; arc_buf_hdr_t *ab, *ab_prev;
arc_buf_hdr_t marker = { 0 }; arc_buf_hdr_t marker;
list_t *list = &state->arcs_list[ARC_BUFC_DATA]; list_t *list = &state->arcs_list[ARC_BUFC_DATA];
kmutex_t *hash_lock; kmutex_t *hash_lock;
uint64_t bytes_deleted = 0; uint64_t bytes_deleted = 0;
uint64_t bufs_skipped = 0; uint64_t bufs_skipped = 0;
ASSERT(GHOST_STATE(state)); ASSERT(GHOST_STATE(state));
bzero(&marker, sizeof(marker));
top: top:
mutex_enter(&state->arcs_mtx); mutex_enter(&state->arcs_mtx);
for (ab = list_tail(list); ab; ab = ab_prev) { for (ab = list_tail(list); ab; ab = ab_prev) {

View File

@ -2923,10 +2923,11 @@ dsl_dataset_promote(const char *name, char *conflsnap)
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);

View File

@ -1251,10 +1251,12 @@ static void
dsl_scan_ddt(dsl_scan_t *scn, dmu_tx_t *tx) dsl_scan_ddt(dsl_scan_t *scn, dmu_tx_t *tx)
{ {
ddt_bookmark_t *ddb = &scn->scn_phys.scn_ddt_bookmark; ddt_bookmark_t *ddb = &scn->scn_phys.scn_ddt_bookmark;
ddt_entry_t dde = { 0 }; ddt_entry_t dde;
int error; int error;
uint64_t n = 0; uint64_t n = 0;
bzero(&dde, sizeof (ddt_entry_t));
while ((error = ddt_walk(scn->scn_dp->dp_spa, ddb, &dde)) == 0) { while ((error = ddt_walk(scn->scn_dp->dp_spa, ddb, &dde)) == 0) {
ddt_t *ddt; ddt_t *ddt;