Merge commit 'refs/top-bases/gcc-branch' into gcc-branch
This commit is contained in:
commit
d5db5d6416
|
@ -109,7 +109,7 @@ show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
|
||||||
(void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n",
|
(void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n",
|
||||||
indent, "",
|
indent, "",
|
||||||
prefix,
|
prefix,
|
||||||
indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12),
|
(int)(indent+strlen(prefix)-25-(vs->vs_space ? 0 : 12)),
|
||||||
desc,
|
desc,
|
||||||
vs->vs_space ? 6 : 0, vs->vs_space ? used : "",
|
vs->vs_space ? 6 : 0, vs->vs_space ? used : "",
|
||||||
vs->vs_space ? 6 : 0, vs->vs_space ? avail : "",
|
vs->vs_space ? 6 : 0, vs->vs_space ? avail : "",
|
||||||
|
|
|
@ -1172,7 +1172,7 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms,
|
||||||
if (sets_nvp)
|
if (sets_nvp)
|
||||||
nvlist_free(sets_nvp);
|
nvlist_free(sets_nvp);
|
||||||
(void) snprintf(errbuf, sizeof (errbuf),
|
(void) snprintf(errbuf, sizeof (errbuf),
|
||||||
dgettext(TEXT_DOMAIN, "Who string is NULL"),
|
dgettext(TEXT_DOMAIN, "Who string is NULL: %s"),
|
||||||
whostr);
|
whostr);
|
||||||
return (zfs_error(zhp->zfs_hdl, EZFS_BADWHO, errbuf));
|
return (zfs_error(zhp->zfs_hdl, EZFS_BADWHO, errbuf));
|
||||||
}
|
}
|
||||||
|
@ -2317,7 +2317,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
||||||
localtime_r(&time, &t) == NULL ||
|
localtime_r(&time, &t) == NULL ||
|
||||||
strftime(propbuf, proplen, "%a %b %e %k:%M %Y",
|
strftime(propbuf, proplen, "%a %b %e %k:%M %Y",
|
||||||
&t) == 0)
|
&t) == 0)
|
||||||
(void) snprintf(propbuf, proplen, "%llu", val);
|
(void) snprintf(propbuf, proplen, "%llu", (u_longlong_t) val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
|
||||||
vs->vs_aux), len);
|
vs->vs_aux), len);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
(void) snprintf(buf, len, "%llu", intval);
|
(void) snprintf(buf, len, "%llu", (u_longlong_t)intval);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1661,7 +1661,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid)
|
||||||
libzfs_handle_t *hdl = zhp->zpool_hdl;
|
libzfs_handle_t *hdl = zhp->zpool_hdl;
|
||||||
|
|
||||||
(void) snprintf(msg, sizeof (msg),
|
(void) snprintf(msg, sizeof (msg),
|
||||||
dgettext(TEXT_DOMAIN, "cannot fault %llu"), guid);
|
dgettext(TEXT_DOMAIN, "cannot fault %llu"), (u_longlong_t)guid);
|
||||||
|
|
||||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||||
zc.zc_guid = guid;
|
zc.zc_guid = guid;
|
||||||
|
@ -1695,7 +1695,7 @@ zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid)
|
||||||
libzfs_handle_t *hdl = zhp->zpool_hdl;
|
libzfs_handle_t *hdl = zhp->zpool_hdl;
|
||||||
|
|
||||||
(void) snprintf(msg, sizeof (msg),
|
(void) snprintf(msg, sizeof (msg),
|
||||||
dgettext(TEXT_DOMAIN, "cannot degrade %llu"), guid);
|
dgettext(TEXT_DOMAIN, "cannot degrade %llu"), (u_longlong_t)guid);
|
||||||
|
|
||||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||||
zc.zc_guid = guid;
|
zc.zc_guid = guid;
|
||||||
|
@ -2068,7 +2068,7 @@ zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
|
||||||
|
|
||||||
(void) snprintf(msg, sizeof (msg),
|
(void) snprintf(msg, sizeof (msg),
|
||||||
dgettext(TEXT_DOMAIN, "cannot clear errors for %llx"),
|
dgettext(TEXT_DOMAIN, "cannot clear errors for %llx"),
|
||||||
guid);
|
(u_longlong_t)guid);
|
||||||
|
|
||||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||||
zc.zc_guid = guid;
|
zc.zc_guid = guid;
|
||||||
|
@ -2727,7 +2727,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
|
||||||
|
|
||||||
if (dsobj == 0) {
|
if (dsobj == 0) {
|
||||||
/* special case for the MOS */
|
/* special case for the MOS */
|
||||||
(void) snprintf(pathname, len, "<metadata>:<0x%llx>", obj);
|
(void) snprintf(pathname, len, "<metadata>:<0x%llx>", (longlong_t)obj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2738,7 +2738,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
|
||||||
ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) {
|
ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) {
|
||||||
/* just write out a path of two object numbers */
|
/* just write out a path of two object numbers */
|
||||||
(void) snprintf(pathname, len, "<0x%llx>:<0x%llx>",
|
(void) snprintf(pathname, len, "<0x%llx>:<0x%llx>",
|
||||||
dsobj, obj);
|
(longlong_t)dsobj, (longlong_t)obj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(void) strlcpy(dsname, zc.zc_value, sizeof (dsname));
|
(void) strlcpy(dsname, zc.zc_value, sizeof (dsname));
|
||||||
|
@ -2759,7 +2759,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
|
||||||
dsname, zc.zc_value);
|
dsname, zc.zc_value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(void) snprintf(pathname, len, "%s:<0x%llx>", dsname, obj);
|
(void) snprintf(pathname, len, "%s:<0x%llx>", dsname, (longlong_t)obj);
|
||||||
}
|
}
|
||||||
free(mntpnt);
|
free(mntpnt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -915,7 +915,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
|
||||||
|
|
||||||
(void) strncpy(newname, name, baselen);
|
(void) strncpy(newname, name, baselen);
|
||||||
(void) snprintf(newname+baselen, ZFS_MAXNAMELEN-baselen,
|
(void) snprintf(newname+baselen, ZFS_MAXNAMELEN-baselen,
|
||||||
"recv-%u-%u", getpid(), seq);
|
"recv-%ld-%u", (long) getpid(), seq);
|
||||||
(void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value));
|
(void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value));
|
||||||
|
|
||||||
if (flags.verbose) {
|
if (flags.verbose) {
|
||||||
|
@ -1665,7 +1665,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||||
(void) printf("found clone origin %s\n", zc.zc_string);
|
(void) printf("found clone origin %s\n", zc.zc_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_wantsnewfs = (drrb->drr_fromguid == NULL ||
|
stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
|
||||||
(drrb->drr_flags & DRR_FLAG_CLONE));
|
(drrb->drr_flags & DRR_FLAG_CLONE));
|
||||||
|
|
||||||
if (stream_wantsnewfs) {
|
if (stream_wantsnewfs) {
|
||||||
|
|
|
@ -520,13 +520,13 @@ zfs_nicenum(uint64_t num, char *buf, size_t buflen)
|
||||||
u = " KMGTPE"[index];
|
u = " KMGTPE"[index];
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
(void) snprintf(buf, buflen, "%llu", n);
|
(void) snprintf(buf, buflen, "%llu", (u_longlong_t) n);
|
||||||
} else if ((num & ((1ULL << 10 * index) - 1)) == 0) {
|
} else if ((num & ((1ULL << 10 * index) - 1)) == 0) {
|
||||||
/*
|
/*
|
||||||
* If this is an even multiple of the base, always display
|
* If this is an even multiple of the base, always display
|
||||||
* without any decimal precision.
|
* without any decimal precision.
|
||||||
*/
|
*/
|
||||||
(void) snprintf(buf, buflen, "%llu%c", n, u);
|
(void) snprintf(buf, buflen, "%llu%c", (u_longlong_t) n, u);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* We want to choose a precision that reflects the best choice
|
* We want to choose a precision that reflects the best choice
|
||||||
|
@ -670,7 +670,7 @@ zcmd_alloc_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, size_t len)
|
||||||
len = 2048;
|
len = 2048;
|
||||||
zc->zc_nvlist_dst_size = len;
|
zc->zc_nvlist_dst_size = len;
|
||||||
if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
|
if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
|
||||||
zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == NULL)
|
zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -686,8 +686,7 @@ zcmd_expand_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc)
|
||||||
{
|
{
|
||||||
free((void *)(uintptr_t)zc->zc_nvlist_dst);
|
free((void *)(uintptr_t)zc->zc_nvlist_dst);
|
||||||
if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
|
if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
|
||||||
zfs_alloc(hdl, zc->zc_nvlist_dst_size))
|
zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0)
|
||||||
== NULL)
|
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|
|
@ -476,7 +476,7 @@ zap_open_leaf(uint64_t blkid, dmu_buf_t *db)
|
||||||
ASSERT3U(ZAP_LEAF_HASH_NUMENTRIES(l), >, ZAP_LEAF_NUMCHUNKS(l) / 3);
|
ASSERT3U(ZAP_LEAF_HASH_NUMENTRIES(l), >, ZAP_LEAF_NUMCHUNKS(l) / 3);
|
||||||
|
|
||||||
/* The chunks should begin at the end of the hash table */
|
/* The chunks should begin at the end of the hash table */
|
||||||
ASSERT3P(&ZAP_LEAF_CHUNK(l, 0), ==,
|
ASSERT3P(&ZAP_LEAF_CHUNK(l, 0), ==, (zap_leaf_chunk_t *)
|
||||||
&l->l_phys->l_hash[ZAP_LEAF_HASH_NUMENTRIES(l)]);
|
&l->l_phys->l_hash[ZAP_LEAF_HASH_NUMENTRIES(l)]);
|
||||||
|
|
||||||
/* The chunks should end at the end of the block */
|
/* The chunks should end at the end of the block */
|
||||||
|
|
|
@ -142,7 +142,7 @@ history_str_get(zfs_cmd_t *zc)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
if (zc->zc_history == NULL)
|
if (zc->zc_history == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP);
|
buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP);
|
||||||
|
@ -1271,7 +1271,7 @@ zfs_ioc_objset_zplprops(zfs_cmd_t *zc)
|
||||||
* which we aren't supposed to do with a DS_MODE_USER
|
* which we aren't supposed to do with a DS_MODE_USER
|
||||||
* hold, because it could be inconsistent.
|
* hold, because it could be inconsistent.
|
||||||
*/
|
*/
|
||||||
if (zc->zc_nvlist_dst != NULL &&
|
if (zc->zc_nvlist_dst != 0 &&
|
||||||
!zc->zc_objset_stats.dds_inconsistent &&
|
!zc->zc_objset_stats.dds_inconsistent &&
|
||||||
dmu_objset_type(os) == DMU_OST_ZFS) {
|
dmu_objset_type(os) == DMU_OST_ZFS) {
|
||||||
nvlist_t *nv;
|
nvlist_t *nv;
|
||||||
|
@ -1669,7 +1669,7 @@ zfs_ioc_pool_get_props(zfs_cmd_t *zc)
|
||||||
|
|
||||||
error = spa_prop_get(spa, &nvp);
|
error = spa_prop_get(spa, &nvp);
|
||||||
|
|
||||||
if (error == 0 && zc->zc_nvlist_dst != NULL)
|
if (error == 0 && zc->zc_nvlist_dst != 0)
|
||||||
error = put_nvlist(zc, nvp);
|
error = put_nvlist(zc, nvp);
|
||||||
else
|
else
|
||||||
error = EFAULT;
|
error = EFAULT;
|
||||||
|
@ -2045,7 +2045,7 @@ zfs_ioc_create(zfs_cmd_t *zc)
|
||||||
strchr(zc->zc_name, '%'))
|
strchr(zc->zc_name, '%'))
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
|
||||||
if (zc->zc_nvlist_src != NULL &&
|
if (zc->zc_nvlist_src != 0 &&
|
||||||
(error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
|
(error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
|
||||||
&nvprops)) != 0)
|
&nvprops)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
@ -2441,7 +2441,7 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
||||||
*tosnap = '\0';
|
*tosnap = '\0';
|
||||||
tosnap++;
|
tosnap++;
|
||||||
|
|
||||||
if (zc->zc_nvlist_src != NULL &&
|
if (zc->zc_nvlist_src != 0 &&
|
||||||
(error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
|
(error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
|
||||||
&props)) != 0)
|
&props)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1453,7 +1453,7 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data)
|
||||||
/* can't upgrade */
|
/* can't upgrade */
|
||||||
(void) printf(gettext("%s: can not be upgraded; "
|
(void) printf(gettext("%s: can not be upgraded; "
|
||||||
"the pool version needs to first be upgraded\nto "
|
"the pool version needs to first be upgraded\nto "
|
||||||
"version %d\n\n"),
|
"version %llu\n\n"),
|
||||||
zfs_get_name(zhp), SPA_VERSION_FUID);
|
zfs_get_name(zhp), SPA_VERSION_FUID);
|
||||||
cb->cb_numfailed++;
|
cb->cb_numfailed++;
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -1464,7 +1464,7 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data)
|
||||||
if (version < cb->cb_version) {
|
if (version < cb->cb_version) {
|
||||||
char verstr[16];
|
char verstr[16];
|
||||||
(void) snprintf(verstr, sizeof (verstr),
|
(void) snprintf(verstr, sizeof (verstr),
|
||||||
"%llu", cb->cb_version);
|
"%llu", (u_longlong_t)cb->cb_version);
|
||||||
if (cb->cb_lastfs[0] && !same_pool(zhp, cb->cb_lastfs)) {
|
if (cb->cb_lastfs[0] && !same_pool(zhp, cb->cb_lastfs)) {
|
||||||
/*
|
/*
|
||||||
* If they did "zfs upgrade -a", then we could
|
* If they did "zfs upgrade -a", then we could
|
||||||
|
@ -1570,11 +1570,11 @@ zfs_do_upgrade(int argc, char **argv)
|
||||||
ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_FILESYSTEM,
|
ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_FILESYSTEM,
|
||||||
NULL, NULL, upgrade_set_callback, &cb);
|
NULL, NULL, upgrade_set_callback, &cb);
|
||||||
(void) printf(gettext("%llu filesystems upgraded\n"),
|
(void) printf(gettext("%llu filesystems upgraded\n"),
|
||||||
cb.cb_numupgraded);
|
(u_longlong_t)cb.cb_numupgraded);
|
||||||
if (cb.cb_numsamegraded) {
|
if (cb.cb_numsamegraded) {
|
||||||
(void) printf(gettext("%llu filesystems already at "
|
(void) printf(gettext("%llu filesystems already at "
|
||||||
"this version\n"),
|
"this version\n"),
|
||||||
cb.cb_numsamegraded);
|
(u_longlong_t)cb.cb_numsamegraded);
|
||||||
}
|
}
|
||||||
if (cb.cb_numfailed != 0)
|
if (cb.cb_numfailed != 0)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -1659,9 +1659,9 @@ print_header(zprop_list_t *pl)
|
||||||
if (pl->pl_next == NULL && !right_justify)
|
if (pl->pl_next == NULL && !right_justify)
|
||||||
(void) printf("%s", header);
|
(void) printf("%s", header);
|
||||||
else if (right_justify)
|
else if (right_justify)
|
||||||
(void) printf("%*s", pl->pl_width, header);
|
(void) printf("%*s", (int)pl->pl_width, header);
|
||||||
else
|
else
|
||||||
(void) printf("%-*s", pl->pl_width, header);
|
(void) printf("%-*s", (int)pl->pl_width, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf("\n");
|
(void) printf("\n");
|
||||||
|
|
|
@ -2061,9 +2061,9 @@ print_header(zprop_list_t *pl)
|
||||||
if (pl->pl_next == NULL && !right_justify)
|
if (pl->pl_next == NULL && !right_justify)
|
||||||
(void) printf("%s", header);
|
(void) printf("%s", header);
|
||||||
else if (right_justify)
|
else if (right_justify)
|
||||||
(void) printf("%*s", pl->pl_width, header);
|
(void) printf("%*s", (int)pl->pl_width, header);
|
||||||
else
|
else
|
||||||
(void) printf("%-*s", pl->pl_width, header);
|
(void) printf("%-*s", (int)pl->pl_width, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf("\n");
|
(void) printf("\n");
|
||||||
|
@ -3368,7 +3368,7 @@ upgrade_one(zpool_handle_t *zhp, void *data)
|
||||||
if (cur_version > cbp->cb_version) {
|
if (cur_version > cbp->cb_version) {
|
||||||
(void) printf(gettext("Pool '%s' is already formatted "
|
(void) printf(gettext("Pool '%s' is already formatted "
|
||||||
"using more current version '%llu'.\n"),
|
"using more current version '%llu'.\n"),
|
||||||
zpool_get_name(zhp), cur_version);
|
zpool_get_name(zhp), (u_longlong_t) cur_version);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (cur_version == cbp->cb_version) {
|
if (cur_version == cbp->cb_version) {
|
||||||
|
@ -3631,8 +3631,8 @@ get_history_one(zpool_handle_t *zhp, void *data)
|
||||||
continue;
|
continue;
|
||||||
(void) snprintf(internalstr,
|
(void) snprintf(internalstr,
|
||||||
sizeof (internalstr),
|
sizeof (internalstr),
|
||||||
"[internal %s txg:%lld] %s",
|
"[internal %s txg:%llu] %s",
|
||||||
hist_event_table[ievent], txg,
|
hist_event_table[ievent], (u_longlong_t)txg,
|
||||||
pathstr);
|
pathstr);
|
||||||
cmdstr = internalstr;
|
cmdstr = internalstr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue