From 696ec7fb61eb1c061df74f2ac6bfd448dd119001 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 15:44:06 -0700 Subject: [PATCH 1/3] Update gcc-missing-braces based on structure changes Almost exclusively this patch handled the addition of another char array to the zfs_cmd_t structure. Unfortunately c90 doesn't allow zero filling the entire struct with the '= { 0 };' shorthand. --- cmd/zdb/zdb.c | 7 ++++-- lib/libzfs/libzfs_config.c | 4 ++-- lib/libzfs/libzfs_dataset.c | 46 ++++++++++++++++++------------------ lib/libzfs/libzfs_graph.c | 4 ++-- lib/libzfs/libzfs_import.c | 2 +- lib/libzfs/libzfs_pool.c | 46 ++++++++++++++++++------------------ lib/libzfs/libzfs_sendrecv.c | 18 +++++++------- module/zfs/dsl_scan.c | 4 +++- 8 files changed, 68 insertions(+), 63 deletions(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index f6d9f606de..1f4fcfef7a 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -2391,8 +2391,11 @@ dump_simulated_ddt(spa_t *spa) avl_tree_t t; void *cookie = NULL; zdb_ddt_entry_t *zdde; - ddt_histogram_t ddh_total = { 0 }; - ddt_stat_t dds_total = { 0 }; + ddt_histogram_t ddh_total; + 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, sizeof (zdb_ddt_entry_t), offsetof(zdb_ddt_entry_t, zdde_node)); diff --git a/lib/libzfs/libzfs_config.c b/lib/libzfs/libzfs_config.c index 9b875ee1f3..f1ddac98ab 100644 --- a/lib/libzfs/libzfs_config.c +++ b/lib/libzfs/libzfs_config.c @@ -101,7 +101,7 @@ namespace_reload(libzfs_handle_t *hdl) nvlist_t *config; config_node_t *cn; nvpair_t *elem; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; void *cookie; if (hdl->libzfs_ns_gen == 0) { @@ -226,7 +226,7 @@ zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig) int zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int error; nvlist_t *config; libzfs_handle_t *hdl = zhp->zpool_hdl; diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 07a0dd78b6..64ec910dac 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -345,7 +345,7 @@ get_recvd_props_ioctl(zfs_handle_t *zhp) { libzfs_handle_t *hdl = zhp->zfs_hdl; nvlist_t *recvdprops; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int err; if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0) @@ -408,7 +408,7 @@ static int get_stats(zfs_handle_t *zhp) { int rc = 0; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0) return (-1); @@ -468,7 +468,7 @@ make_dataset_handle_common(zfs_handle_t *zhp, zfs_cmd_t *zc) zfs_handle_t * make_dataset_handle(libzfs_handle_t *hdl, const char *path) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); @@ -1337,7 +1337,7 @@ zfs_setprop_error(libzfs_handle_t *hdl, zfs_prop_t prop, int err, int zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret = -1; prop_changelist_t *cl = NULL; char errbuf[1024]; @@ -1427,7 +1427,7 @@ error: int zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret; prop_changelist_t *cl; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -1602,7 +1602,7 @@ static int get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, char **source, uint64_t *val) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; nvlist_t *zplprops = NULL; struct mnttab mnt; char *mntopt_on = NULL; @@ -2324,7 +2324,7 @@ zfs_prop_get_userquota_common(zfs_handle_t *zhp, const char *propname, uint64_t *propvalue, zfs_userquota_prop_t *typep) { int err; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; (void) strncpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); @@ -2442,7 +2442,7 @@ top: int zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zfs_handle_t *nzhp; int ret; @@ -2478,7 +2478,7 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) int zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zfs_handle_t *nzhp; int ret; @@ -2569,7 +2569,7 @@ static int check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned, boolean_t accept_ancestor, int *prefixlen) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char parent[ZFS_MAXNAMELEN]; char *slash; zfs_handle_t *zhp; @@ -2777,7 +2777,7 @@ int zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, nvlist_t *props) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret; uint64_t size = 0; uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); @@ -2928,7 +2928,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, int zfs_destroy(zfs_handle_t *zhp, boolean_t defer) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); @@ -2989,7 +2989,7 @@ zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) int zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret; struct destroydata dd = { 0 }; @@ -3034,7 +3034,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer) int zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char parent[ZFS_MAXNAMELEN]; int ret; char errbuf[1024]; @@ -3124,7 +3124,7 @@ int zfs_promote(zfs_handle_t *zhp) { libzfs_handle_t *hdl = zhp->zfs_hdl; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char parent[MAXPATHLEN]; int ret; char errbuf[1024]; @@ -3178,7 +3178,7 @@ zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive, const char *delim; char parent[ZFS_MAXNAMELEN]; zfs_handle_t *zhp; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret; char errbuf[1024]; @@ -3310,7 +3310,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force) { rollback_data_t cb = { 0 }; int err; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; boolean_t restore_resv = 0; uint64_t old_volsize, new_volsize; zfs_prop_t resv_prop; @@ -3426,7 +3426,7 @@ int zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive) { int ret; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char *delim; prop_changelist_t *cl = NULL; zfs_handle_t *zhrp = NULL; @@ -3732,7 +3732,7 @@ zfs_deleg_share_nfs(libzfs_handle_t *hdl, char *dataset, char *path, char *resource, void *export, void *sharetab, int sharemax, zfs_share_op_t operation) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int error; (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); @@ -3782,7 +3782,7 @@ static int zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path, zfs_smb_acl_op_t cmd, char *resource1, char *resource2) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; nvlist_t *nvlist = NULL; int error; @@ -3864,7 +3864,7 @@ int zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type, zfs_userspace_cb_t func, void *arg) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int error; zfs_useracct_t buf[100]; @@ -3900,7 +3900,7 @@ int zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag, boolean_t recursive, boolean_t temphold, boolean_t enoent_ok) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); @@ -4049,7 +4049,7 @@ int zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag, boolean_t recursive) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); diff --git a/lib/libzfs/libzfs_graph.c b/lib/libzfs/libzfs_graph.c index 48e722edb0..0e538e3ded 100644 --- a/lib/libzfs/libzfs_graph.c +++ b/lib/libzfs/libzfs_graph.c @@ -379,7 +379,7 @@ zfs_graph_add(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *source, static int iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zfs_vertex_t *zvp; /* @@ -473,7 +473,7 @@ iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) static boolean_t external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; /* * Check whether this dataset is a clone or has clones since diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index 091b1cfc3d..064a89ac31 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -371,7 +371,7 @@ static nvlist_t * refresh_config(libzfs_handle_t *hdl, nvlist_t *config) { nvlist_t *nvl; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int err; if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 5c7cf8ccbb..340015c717 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -63,7 +63,7 @@ static int read_efi_label(nvlist_t *config, diskaddr_t *sb); static int zpool_get_all_props(zpool_handle_t *zhp) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); @@ -556,7 +556,7 @@ error: int zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret = -1; char errbuf[1024]; nvlist_t *nvl = NULL; @@ -867,7 +867,7 @@ int zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot, nvlist_t *props, nvlist_t *fsprops) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; @@ -997,7 +997,7 @@ create_failed: int zpool_destroy(zpool_handle_t *zhp) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zfs_handle_t *zfp = NULL; libzfs_handle_t *hdl = zhp->zpool_hdl; char msg[1024]; @@ -1041,7 +1041,7 @@ zpool_destroy(zpool_handle_t *zhp) int zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int ret; libzfs_handle_t *hdl = zhp->zpool_hdl; char msg[1024]; @@ -1165,7 +1165,7 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot) int zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, @@ -1375,7 +1375,7 @@ int zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, nvlist_t *props, boolean_t importfaulted) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zpool_rewind_policy_t policy; nvlist_t *nvi = NULL; char *thename; @@ -1519,7 +1519,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, int zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2069,7 +2069,7 @@ int zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags, vdev_state_t *newstate) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache, islog; @@ -2141,7 +2141,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags, int zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -2191,7 +2191,7 @@ zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp) int zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2226,7 +2226,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux) int zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2280,7 +2280,7 @@ int zpool_vdev_attach(zpool_handle_t *zhp, const char *old_disk, const char *new_disk, nvlist_t *nvroot, int replacing) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; int ret; nvlist_t *tgt; @@ -2471,7 +2471,7 @@ zpool_vdev_attach(zpool_handle_t *zhp, int zpool_vdev_detach(zpool_handle_t *zhp, const char *path) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -2569,7 +2569,7 @@ int zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot, nvlist_t *props, splitflags_t flags) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL; nvlist_t **varray = NULL, *zc_props = NULL; @@ -2779,7 +2779,7 @@ out: int zpool_vdev_remove(zpool_handle_t *zhp, const char *path) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache, islog; @@ -2824,7 +2824,7 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path) int zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; zpool_rewind_policy_t policy; @@ -2892,7 +2892,7 @@ zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl) int zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2976,7 +2976,7 @@ path_to_devid(const char *path) static void set_path(zpool_handle_t *zhp, nvlist_t *nv, const char *path) { - zfs_cmd_t zc = { "\0", "\0", "\0", 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_value, path, sizeof (zc.zc_value)); @@ -3127,7 +3127,7 @@ zbookmark_compare(const void *a, const void *b) int zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; uint64_t count; zbookmark_t *zb = NULL; int i; @@ -3223,7 +3223,7 @@ nomem: int zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strcpy(zc.zc_name, zhp->zpool_name); @@ -3285,7 +3285,7 @@ zpool_stage_history(libzfs_handle_t *hdl, const char *history_str) static int get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); @@ -3412,7 +3412,7 @@ void zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj, char *pathname, size_t len) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; boolean_t mounted = B_FALSE; char *mntpnt = NULL; char dsname[MAXNAMELEN]; diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 8e9297c9e2..9aa667b8a2 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -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, int, const char *, nvlist_t *, avl_tree_t *, char **); -static const zio_cksum_t zero_cksum = { 0 }; +static const zio_cksum_t zero_cksum = { { 0 } }; typedef struct dedup_arg { int inputfd; @@ -863,7 +863,7 @@ static int dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, boolean_t fromorigin, int outfd, boolean_t enoent_ok, boolean_t *got_enoent, nvlist_t *debugnv) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; nvlist_t *thisdbg; @@ -1035,7 +1035,7 @@ dump_filesystem(zfs_handle_t *zhp, void *arg) int rv = 0; send_dump_data_t *sdd = arg; boolean_t missingfrom = B_FALSE; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; (void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s", zhp->zfs_name, sdd->tosnap); @@ -1481,7 +1481,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname, int baselen, char *newname, recvflags_t flags) { static int seq; - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int err; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -1554,7 +1554,7 @@ static int recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen, char *newname, recvflags_t flags) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int err = 0; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -1782,7 +1782,7 @@ again: stream_originguid, originguid)) { case 1: { /* promote it! */ - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; nvlist_t *origin_nvfs; char *origin_fsname; @@ -1854,7 +1854,7 @@ again: if (0 == nvlist_lookup_nvlist(stream_nvfs, "snapprops", &props) && 0 == nvlist_lookup_nvlist(props, stream_snapname, &props)) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; zc.zc_cookie = B_TRUE; /* received */ (void) snprintf(zc.zc_name, sizeof (zc.zc_name), @@ -2283,7 +2283,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, dmu_replay_record_t *drr_noswap, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; time_t begin_time; int ioctl_err, ioctl_errno, err; char *cp; @@ -2649,7 +2649,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, zcmd_free_nvlists(&zc); if (err == 0 && snapprops_nvlist) { - zfs_cmd_t zc2 = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc2 = { "\0", "\0", "\0", "\0", 0 }; (void) strcpy(zc2.zc_name, zc.zc_value); zc2.zc_cookie = B_TRUE; /* received */ diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 23c37c7ccf..dc91fac778 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -1233,10 +1233,12 @@ static void dsl_scan_ddt(dsl_scan_t *scn, dmu_tx_t *tx) { ddt_bookmark_t *ddb = &scn->scn_phys.scn_ddt_bookmark; - ddt_entry_t dde = { 0 }; + ddt_entry_t dde; int error; uint64_t n = 0; + bzero(&dde, sizeof (ddt_entry_t)); + while ((error = ddt_walk(scn->scn_dp->dp_spa, ddb, &dde)) == 0) { ddt_t *ddt; From ea78161e400219dbd08ddfed6eab25ab8661aa0f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 15:45:23 -0700 Subject: [PATCH 2/3] Update META to version 0.5.0 --- META | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META b/META index 4059082b98..1e1c6fba9d 100644 --- a/META +++ b/META @@ -1,7 +1,7 @@ Meta: 1 Name: zfs Branch: 1.0 -Version: 0.4.9 +Version: 0.5.0 Release: 1 Release-Tags: relext License: CDDL From c430e23552929bbbf0f15ced63de18ba050f4f55 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 15:46:11 -0700 Subject: [PATCH 3/3] Update zfs-branch with build system updates Required Makefile modifications for updated ZFS code. --- lib/libzfs/Makefile.am | 1 + lib/libzpool/Makefile.am | 16 +++++++++++++--- module/zcommon/Makefile.in | 1 + module/zfs/Makefile.in | 11 +++++++++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 7ffd81cf28..24ade074ee 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -20,6 +20,7 @@ libzfs_la_SOURCES = \ ${top_srcdir}/lib/libzfs/libzfs_changelist.c \ ${top_srcdir}/lib/libzfs/libzfs_config.c \ ${top_srcdir}/lib/libzfs/libzfs_dataset.c \ + ${top_srcdir}/lib/libzfs/libzfs_fru.c \ ${top_srcdir}/lib/libzfs/libzfs_graph.c \ ${top_srcdir}/lib/libzfs/libzfs_import.c \ ${top_srcdir}/lib/libzfs/libzfs_mount.c \ diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 039d7f60b8..e28d7304b4 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -19,6 +19,7 @@ libzpool_la_SOURCES = \ ${top_srcdir}/lib/libzpool/util.c \ ${top_srcdir}/module/zcommon/zfs_comutil.c \ ${top_srcdir}/module/zcommon/zfs_deleg.c \ + ${top_srcdir}/module/zcommon/zfs_fletcher.c \ ${top_srcdir}/module/zcommon/zfs_namecheck.c \ ${top_srcdir}/module/zcommon/zfs_prop.c \ ${top_srcdir}/module/zcommon/zpool_prop.c \ @@ -27,11 +28,15 @@ libzpool_la_SOURCES = \ ${top_srcdir}/module/zcommon/include/sys/fs/zfs.h \ ${top_srcdir}/module/zcommon/include/zfs_comutil.h \ ${top_srcdir}/module/zcommon/include/zfs_deleg.h \ + ${top_srcdir}/module/zcommon/include/zfs_fletcher.h \ ${top_srcdir}/module/zcommon/include/zfs_namecheck.h \ ${top_srcdir}/module/zcommon/include/zfs_prop.h \ ${top_srcdir}/module/zfs/arc.c \ ${top_srcdir}/module/zfs/bplist.c \ + ${top_srcdir}/module/zfs/bpobj.c \ ${top_srcdir}/module/zfs/dbuf.c \ + ${top_srcdir}/module/zfs/ddt.c \ + ${top_srcdir}/module/zfs/ddt_zap.c \ ${top_srcdir}/module/zfs/dmu.c \ ${top_srcdir}/module/zfs/dmu_object.c \ ${top_srcdir}/module/zfs/dmu_objset.c \ @@ -42,18 +47,20 @@ libzpool_la_SOURCES = \ ${top_srcdir}/module/zfs/dnode.c \ ${top_srcdir}/module/zfs/dnode_sync.c \ ${top_srcdir}/module/zfs/dsl_dataset.c \ + ${top_srcdir}/module/zfs/dsl_deadlist.c \ ${top_srcdir}/module/zfs/dsl_deleg.c \ ${top_srcdir}/module/zfs/dsl_dir.c \ ${top_srcdir}/module/zfs/dsl_pool.c \ ${top_srcdir}/module/zfs/dsl_prop.c \ - ${top_srcdir}/module/zfs/dsl_scrub.c \ + ${top_srcdir}/module/zfs/dsl_scan.c \ ${top_srcdir}/module/zfs/dsl_synctask.c \ - ${top_srcdir}/module/zfs/fletcher.c \ ${top_srcdir}/module/zfs/fm.c \ ${top_srcdir}/module/zfs/gzip.c \ ${top_srcdir}/module/zfs/lzjb.c \ ${top_srcdir}/module/zfs/metaslab.c \ ${top_srcdir}/module/zfs/refcount.c \ + ${top_srcdir}/module/zfs/rrwlock.c \ + ${top_srcdir}/module/zfs/sa.c \ ${top_srcdir}/module/zfs/sha256.c \ ${top_srcdir}/module/zfs/spa.c \ ${top_srcdir}/module/zfs/spa_boot.c \ @@ -69,8 +76,8 @@ libzpool_la_SOURCES = \ ${top_srcdir}/module/zfs/vdev_cache.c \ ${top_srcdir}/module/zfs/vdev_file.c \ ${top_srcdir}/module/zfs/vdev_label.c \ - ${top_srcdir}/module/zfs/vdev_missing.c \ ${top_srcdir}/module/zfs/vdev_mirror.c \ + ${top_srcdir}/module/zfs/vdev_missing.c \ ${top_srcdir}/module/zfs/vdev_queue.c \ ${top_srcdir}/module/zfs/vdev_raidz.c \ ${top_srcdir}/module/zfs/vdev_root.c \ @@ -78,14 +85,17 @@ libzpool_la_SOURCES = \ ${top_srcdir}/module/zfs/zap_leaf.c \ ${top_srcdir}/module/zfs/zap_micro.c \ ${top_srcdir}/module/zfs/zfs_byteswap.c \ + ${top_srcdir}/module/zfs/zfs_debug.c \ ${top_srcdir}/module/zfs/zfs_fm.c \ ${top_srcdir}/module/zfs/zfs_fuid.c \ + ${top_srcdir}/module/zfs/zfs_sa.c \ ${top_srcdir}/module/zfs/zfs_znode.c \ ${top_srcdir}/module/zfs/zil.c \ ${top_srcdir}/module/zfs/zio.c \ ${top_srcdir}/module/zfs/zio_checksum.c \ ${top_srcdir}/module/zfs/zio_compress.c \ ${top_srcdir}/module/zfs/zio_inject.c \ + ${top_srcdir}/module/zfs/zle.c \ ${top_srcdir}/module/zfs/include/sys/arc.h \ ${top_srcdir}/module/zfs/include/sys/bplist.h \ ${top_srcdir}/module/zfs/include/sys/dbuf.h \ diff --git a/module/zcommon/Makefile.in b/module/zcommon/Makefile.in index 58e2591f60..def2b7d978 100644 --- a/module/zcommon/Makefile.in +++ b/module/zcommon/Makefile.in @@ -14,4 +14,5 @@ ${MODULE}-objs += zfs_prop.o ${MODULE}-objs += zprop_common.o ${MODULE}-objs += zfs_namecheck.o ${MODULE}-objs += zfs_comutil.o +${MODULE}-objs += zfs_fletcher.o ${MODULE}-objs += zpool_prop.o diff --git a/module/zfs/Makefile.in b/module/zfs/Makefile.in index 2894008810..3b7a12dea7 100644 --- a/module/zfs/Makefile.in +++ b/module/zfs/Makefile.in @@ -11,7 +11,10 @@ obj-m := ${MODULE}.o ${MODULE}-objs += arc.o ${MODULE}-objs += bplist.o +${MODULE}-objs += bpobj.o ${MODULE}-objs += dbuf.o +${MODULE}-objs += ddt.o +${MODULE}-objs += ddt_zap.o ${MODULE}-objs += dmu.o ${MODULE}-objs += dmu_object.o ${MODULE}-objs += dmu_objset.o @@ -22,19 +25,20 @@ ${MODULE}-objs += dmu_zfetch.o ${MODULE}-objs += dnode.o ${MODULE}-objs += dnode_sync.o ${MODULE}-objs += dsl_dataset.o +${MODULE}-objs += dsl_deadlist.o ${MODULE}-objs += dsl_deleg.o ${MODULE}-objs += dsl_dir.o ${MODULE}-objs += dsl_pool.o ${MODULE}-objs += dsl_prop.o -${MODULE}-objs += dsl_scrub.o +${MODULE}-objs += dsl_scan.o ${MODULE}-objs += dsl_synctask.o -${MODULE}-objs += fletcher.o ${MODULE}-objs += fm.o ${MODULE}-objs += gzip.o ${MODULE}-objs += lzjb.o ${MODULE}-objs += metaslab.o ${MODULE}-objs += refcount.o ${MODULE}-objs += rrwlock.o +${MODULE}-objs += sa.o ${MODULE}-objs += sha256.o ${MODULE}-objs += spa.o ${MODULE}-objs += spa_boot.o @@ -61,6 +65,7 @@ ${MODULE}-objs += zap_micro.o ${MODULE}-objs += zfs_acl.o ${MODULE}-objs += zfs_byteswap.o ${MODULE}-objs += zfs_ctldir.o +${MODULE}-objs += zfs_debug.o ${MODULE}-objs += zfs_dir.o ${MODULE}-objs += zfs_fm.o ${MODULE}-objs += zfs_fuid.o @@ -68,6 +73,7 @@ ${MODULE}-objs += zfs_ioctl.o ${MODULE}-objs += zfs_log.o ${MODULE}-objs += zfs_replay.o ${MODULE}-objs += zfs_rlock.o +${MODULE}-objs += zfs_sa.o ${MODULE}-objs += zfs_vfsops.o ${MODULE}-objs += zfs_vnops.o ${MODULE}-objs += zfs_znode.o @@ -76,4 +82,5 @@ ${MODULE}-objs += zio.o ${MODULE}-objs += zio_checksum.o ${MODULE}-objs += zio_compress.o ${MODULE}-objs += zio_inject.o +${MODULE}-objs += zle.o ${MODULE}-objs += zvol.o