(void) snprintf(internalstr,
sizeof (internalstr),
"[internal %s txg:%lld] %s",
- zfs_history_event_names[ievent], txg,
- intstr);
+ zfs_history_event_names[ievent],
+ (longlong_t)txg, intstr);
cmd = internalstr;
}
tsec = time;
if (version < cb->cb_version) {
char verstr[16];
(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 they did "zfs upgrade -a", then we could
boolean_t showversions = B_FALSE;
int ret;
upgrade_cbdata_t cb = { 0 };
- char c;
+ signed char c;
int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
/* check options */
ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_FILESYSTEM,
NULL, NULL, 0, upgrade_set_callback, &cb);
(void) printf(gettext("%llu filesystems upgraded\n"),
- cb.cb_numupgraded);
+ (u_longlong_t)cb.cb_numupgraded);
if (cb.cb_numsamegraded) {
(void) printf(gettext("%llu filesystems already at "
"this version\n"),
- cb.cb_numsamegraded);
+ (u_longlong_t)cb.cb_numsamegraded);
}
if (cb.cb_numfailed != 0)
ret = 1;
if (pl->pl_next == NULL && !right_justify)
(void) printf("%s", header);
else if (right_justify)
- (void) printf("%*s", pl->pl_width, header);
+ (void) printf("%*s", (int)pl->pl_width, header);
else
- (void) printf("%-*s", pl->pl_width, header);
+ (void) printf("%-*s", (int)pl->pl_width, header);
}
(void) printf("\n");
usage(B_FALSE);
}
- ret = zfs_for_each(argc - 2, argv + 2, NULL,
+ ret = zfs_for_each(argc - 2, argv + 2, 0,
ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, &cb);
return (ret);
{
boolean_t recursive = B_FALSE;
int ret;
- char c;
+ signed char c;
nvlist_t *props;
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
if (pl->pl_next == NULL && !right_justify)
(void) printf("%s", header);
else if (right_justify)
- (void) printf("%*s", pl->pl_width, header);
+ (void) printf("%*s", (int)pl->pl_width, header);
else
- (void) printf("%-*s", pl->pl_width, header);
+ (void) printf("%-*s", (int)pl->pl_width, header);
}
(void) printf("\n");
if (cur_version > cbp->cb_version) {
(void) printf(gettext("Pool '%s' is already formatted "
"using more current version '%llu'.\n"),
- zpool_get_name(zhp), cur_version);
+ zpool_get_name(zhp), (u_longlong_t) cur_version);
return (0);
}
if (cur_version == cbp->cb_version) {
continue;
(void) snprintf(internalstr,
sizeof (internalstr),
- "[internal %s txg:%lld] %s",
- zfs_history_event_names[ievent], txg,
+ "[internal %s txg:%llu] %s",
+ zfs_history_event_names[ievent], (u_longlong_t)txg,
pathstr);
cmdstr = internalstr;
}
od->od_gen = 0;
(void) snprintf(od->od_name, sizeof (od->od_name), "%s(%lld)[%llu]",
- tag, (int64_t)id, index);
+ tag, (longlong_t)id, (u_longlong_t)index);
}
/*
char snap3name[MAXNAMELEN];
int error;
- (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu", osname, id);
- (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu", osname, id);
- (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu", clone1name, id);
- (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
- (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
+ (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu",
+ clone1name, (u_longlong_t)id);
+ (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu",
+ clone1name, (u_longlong_t)id);
error = dmu_objset_destroy(clone2name, B_FALSE);
if (error && error != ENOENT)
ztest_dsl_dataset_cleanup(osname, id);
- (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu", osname, id);
- (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu", osname, id);
- (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu", clone1name, id);
- (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
- (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
+ (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu",
+ clone1name, (u_longlong_t)id);
+ (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu",
+ osname, (u_longlong_t)id);
+ (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu",
+ clone1name, (u_longlong_t)id);
error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1,
NULL, NULL, B_FALSE, B_FALSE, -1);
int error;
(void) snprintf(name, sizeof (name), "fzap-%llu-%llu",
- id, value);
+ (u_longlong_t)id, (u_longlong_t)value);
tx = dmu_tx_create(os);
dmu_tx_hold_zap(tx, object, B_TRUE, name);
NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x")
NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld")
NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx")
-NVLIST_PRTFUNC(double, double, double, "0x%llf")
+NVLIST_PRTFUNC(double, double, double, "0x%f")
NVLIST_PRTFUNC(string, char *, char *, "%s")
NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx")
boolean_t val, val_arg;
/* scanf boolean_t from value and check for match */
- sr = sscanf(value, "%"SCNi32, &val_arg);
+ sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
if ((sr == 1) &&
(nvpair_value_boolean_value(nvp, &val) == 0) &&
(val == val_arg))
boolean_t *val_array, val_arg;
/* check indexed value of array for match */
- sr = sscanf(value, "%"SCNi32, &val_arg);
+ sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
if ((sr == 1) &&
(nvpair_value_boolean_array(nvp,
&val_array, &a_len) == 0) &&
localtime_r(&time, &t) == NULL ||
strftime(propbuf, proplen, "%a %b %e %k:%M %Y",
&t) == 0)
- (void) snprintf(propbuf, proplen, "%llu", val);
+ (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t) val);
}
break;
return (err);
if (literal) {
- (void) snprintf(propbuf, proplen, "%llu", propvalue);
+ (void) snprintf(propbuf, proplen, "%llu",
+ (u_longlong_t)propvalue);
} else if (propvalue == 0 &&
(type == ZFS_PROP_USERQUOTA || type == ZFS_PROP_GROUPQUOTA)) {
(void) strlcpy(propbuf, "none", proplen);
(void) snprintf(di->errbuf, sizeof (di->errbuf),
dgettext(TEXT_DOMAIN,
"Unable to determine path or stats for "
- "object %lld in %s"), obj, dsname);
+ "object %lld in %s"), (longlong_t)obj, dsname);
return (-1);
}
}
(void) snprintf(di->errbuf, sizeof (di->errbuf),
dgettext(TEXT_DOMAIN,
"next allocated object (> %lld) find failure"),
- zc.zc_obj);
+ (longlong_t)zc.zc_obj);
di->zerr = errno;
break;
}
case ZPOOL_PROP_GUID:
intval = zpool_get_prop_int(zhp, prop, &src);
- (void) snprintf(buf, len, "%llu", intval);
+ (void) snprintf(buf, len, "%llu", (u_longlong_t)intval);
break;
case ZPOOL_PROP_ALTROOT:
vs->vs_aux), len);
break;
default:
- (void) snprintf(buf, len, "%llu", intval);
+ (void) snprintf(buf, len, "%llu", (u_longlong_t)intval);
}
break;
(void) nvlist_lookup_int64(nv, ZPOOL_CONFIG_REWIND_TIME, &loss);
if (localtime_r((time_t *)&rewindto, &t) != NULL &&
- strftime(timestr, 128, 0, &t) != 0) {
+ strftime(timestr, 128, "%c", &t) != 0) {
if (dryrun) {
(void) printf(dgettext(TEXT_DOMAIN,
"Would be able to return %s "
(void) printf(dgettext(TEXT_DOMAIN,
"%s approximately %lld "),
dryrun ? "Would discard" : "Discarded",
- (loss + 30) / 60);
+ ((longlong_t)loss + 30) / 60);
(void) printf(dgettext(TEXT_DOMAIN,
"minutes of transactions.\n"));
} else if (loss > 0) {
(void) printf(dgettext(TEXT_DOMAIN,
"%s approximately %lld "),
- dryrun ? "Would discard" : "Discarded", loss);
+ dryrun ? "Would discard" : "Discarded",
+ (longlong_t)loss);
(void) printf(dgettext(TEXT_DOMAIN,
"seconds of transactions.\n"));
}
"Recovery is possible, but will result in some data loss.\n"));
if (localtime_r((time_t *)&rewindto, &t) != NULL &&
- strftime(timestr, 128, 0, &t) != 0) {
+ strftime(timestr, 128, "%c", &t) != 0) {
(void) printf(dgettext(TEXT_DOMAIN,
"\tReturning the pool to its state as of %s\n"
"\tshould correct the problem. "),
if (loss > 120) {
(void) printf(dgettext(TEXT_DOMAIN,
"Approximately %lld minutes of data\n"
- "\tmust be discarded, irreversibly. "), (loss + 30) / 60);
+ "\tmust be discarded, irreversibly. "),
+ ((longlong_t)loss + 30) / 60);
} else if (loss > 0) {
(void) printf(dgettext(TEXT_DOMAIN,
"Approximately %lld seconds of data\n"
- "\tmust be discarded, irreversibly. "), loss);
+ "\tmust be discarded, irreversibly. "),
+ (longlong_t)loss);
}
if (edata != 0 && edata != UINT64_MAX) {
if (edata == 1) {
libzfs_handle_t *hdl = zhp->zpool_hdl;
(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));
zc.zc_guid = guid;
libzfs_handle_t *hdl = zhp->zpool_hdl;
(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));
zc.zc_guid = guid;
(void) snprintf(msg, sizeof (msg),
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));
zc.zc_guid = guid;
if (dsobj == 0) {
/* special case for the MOS */
- (void) snprintf(pathname, len, "<metadata>:<0x%llx>", obj);
+ (void) snprintf(pathname, len, "<metadata>:<0x%llx>", (longlong_t)obj);
return;
}
ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) {
/* just write out a path of two object numbers */
(void) snprintf(pathname, len, "<0x%llx>:<0x%llx>",
- dsobj, obj);
+ (longlong_t)dsobj, (longlong_t)obj);
return;
}
(void) strlcpy(dsname, zc.zc_value, sizeof (dsname));
dsname, zc.zc_value);
}
} else {
- (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, obj);
+ (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, (longlong_t)obj);
}
free(mntpnt);
}
(void) strncpy(newname, name, 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));
if (flags.verbose) {
(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));
if (stream_wantsnewfs) {
u = " KMGTPE"[index];
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) {
/*
* If this is an even multiple of the base, always display
* without any decimal precision.
*/
- (void) snprintf(buf, buflen, "%llu%c", n, u);
+ (void) snprintf(buf, buflen, "%llu%c", (u_longlong_t) n, u);
} else {
/*
* We want to choose a precision that reflects the best choice
len = 16 * 1024;
zc->zc_nvlist_dst_size = len;
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 (0);
{
free((void *)(uintptr_t)zc->zc_nvlist_dst);
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 (0);
(void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n",
indent, "",
prefix,
- indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12),
+ (int)(indent+strlen(prefix)-25-(vs->vs_space ? 0 : 12)),
desc,
vs->vs_space ? 6 : 0, vs->vs_space ? used : "",
vs->vs_space ? 6 : 0, vs->vs_space ? avail : "",
if (mru_over > 0 && arc_mru_ghost->arcs_lsize[type] > 0) {
int64_t todelete =
MIN(arc_mru_ghost->arcs_lsize[type], mru_over);
- arc_evict_ghost(arc_mru_ghost, NULL, todelete);
+ arc_evict_ghost(arc_mru_ghost, 0, todelete);
} else if (arc_mfu_ghost->arcs_lsize[type] > 0) {
int64_t todelete = MIN(arc_mfu_ghost->arcs_lsize[type],
arc_mru_ghost->arcs_size +
arc_mfu_ghost->arcs_size - arc_c);
- arc_evict_ghost(arc_mfu_ghost, NULL, todelete);
+ arc_evict_ghost(arc_mfu_ghost, 0, todelete);
}
}
if (adjustment > 0 && arc_mru->arcs_lsize[ARC_BUFC_DATA] > 0) {
delta = MIN(arc_mru->arcs_lsize[ARC_BUFC_DATA], adjustment);
- (void) arc_evict(arc_mru, NULL, delta, FALSE, ARC_BUFC_DATA);
+ (void) arc_evict(arc_mru, 0, delta, FALSE, ARC_BUFC_DATA);
adjustment -= delta;
}
if (adjustment > 0 && arc_mru->arcs_lsize[ARC_BUFC_METADATA] > 0) {
delta = MIN(arc_mru->arcs_lsize[ARC_BUFC_METADATA], adjustment);
- (void) arc_evict(arc_mru, NULL, delta, FALSE,
+ (void) arc_evict(arc_mru, 0, delta, FALSE,
ARC_BUFC_METADATA);
}
if (adjustment > 0 && arc_mfu->arcs_lsize[ARC_BUFC_DATA] > 0) {
delta = MIN(adjustment, arc_mfu->arcs_lsize[ARC_BUFC_DATA]);
- (void) arc_evict(arc_mfu, NULL, delta, FALSE, ARC_BUFC_DATA);
+ (void) arc_evict(arc_mfu, 0, delta, FALSE, ARC_BUFC_DATA);
adjustment -= delta;
}
if (adjustment > 0 && arc_mfu->arcs_lsize[ARC_BUFC_METADATA] > 0) {
int64_t delta = MIN(adjustment,
arc_mfu->arcs_lsize[ARC_BUFC_METADATA]);
- (void) arc_evict(arc_mfu, NULL, delta, FALSE,
+ (void) arc_evict(arc_mfu, 0, delta, FALSE,
ARC_BUFC_METADATA);
}
if (adjustment > 0 && arc_mru_ghost->arcs_size > 0) {
delta = MIN(arc_mru_ghost->arcs_size, adjustment);
- arc_evict_ghost(arc_mru_ghost, NULL, delta);
+ arc_evict_ghost(arc_mru_ghost, 0, delta);
}
adjustment =
if (adjustment > 0 && arc_mfu_ghost->arcs_size > 0) {
delta = MIN(arc_mfu_ghost->arcs_size, adjustment);
- arc_evict_ghost(arc_mfu_ghost, NULL, delta);
+ arc_evict_ghost(arc_mfu_ghost, 0, delta);
}
}
state = (arc_mru->arcs_lsize[type] >= size &&
mfu_space > arc_mfu->arcs_size) ? arc_mru : arc_mfu;
}
- if ((buf->b_data = arc_evict(state, NULL, size, TRUE, type)) == NULL) {
+ if ((buf->b_data = arc_evict(state, 0, size, TRUE, type)) == NULL) {
if (type == ARC_BUFC_METADATA) {
buf->b_data = zio_buf_alloc(size);
arc_space_consume(size, ARC_SPACE_DATA);
mutex_enter(&sa->sa_lock);
- if (!sa->sa_need_attr_registration || sa->sa_master_obj == NULL) {
+ if (!sa->sa_need_attr_registration || sa->sa_master_obj == 0) {
mutex_exit(&sa->sa_lock);
return;
}
- if (sa->sa_reg_attr_obj == NULL) {
+ if (sa->sa_reg_attr_obj == 0) {
sa->sa_reg_attr_obj = zap_create(hdl->sa_os,
DMU_OT_SA_ATTR_REGISTRATION, DMU_OT_NONE, 0, tx);
VERIFY(zap_add(hdl->sa_os, sa->sa_master_obj,
ASSERT3U(ZAP_LEAF_HASH_NUMENTRIES(l), >, ZAP_LEAF_NUMCHUNKS(l) / 3);
/* 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)]);
/* The chunks should end at the end of the block */
{
char *buf;
- if (zc->zc_history == NULL)
+ if (zc->zc_history == 0)
return (NULL);
buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP);
* which we aren't supposed to do with a DS_MODE_USER
* hold, because it could be inconsistent.
*/
- if (zc->zc_nvlist_dst != NULL &&
+ if (zc->zc_nvlist_dst != 0 &&
!zc->zc_objset_stats.dds_inconsistent &&
dmu_objset_type(os) == DMU_OST_ZFS) {
nvlist_t *nv;
error = zfs_set_prop_nvlist(zc->zc_name, source, nvl, &errors);
- if (zc->zc_nvlist_dst != NULL && errors != NULL) {
+ if (zc->zc_nvlist_dst != 0 && errors != NULL) {
(void) put_nvlist(zc, errors);
}
spa_close(spa, FTAG);
}
- if (error == 0 && zc->zc_nvlist_dst != NULL)
+ if (error == 0 && zc->zc_nvlist_dst != 0)
error = put_nvlist(zc, nvp);
else
error = EFAULT;
strchr(zc->zc_name, '%'))
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,
zc->zc_iflags, &nvprops)) != 0)
return (error);
if (snapshot_namecheck(zc->zc_value, NULL, NULL) != 0)
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,
zc->zc_iflags, &nvprops)) != 0)
return (error);
tosnap = strchr(tofs, '@');
*tosnap++ = '\0';
- if (zc->zc_nvlist_src != NULL &&
+ if (zc->zc_nvlist_src != 0 &&
(error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
zc->zc_iflags, &props)) != 0)
return (error);
nvlist_t *policy;
nvlist_t *config = NULL;
- if (zc->zc_nvlist_src == NULL)
+ if (zc->zc_nvlist_src == 0)
return (EINVAL);
if ((error = get_nvlist(zc->zc_nvlist_src,
* created a bad performance problem.
*/
if (taskq_dispatch(zilog->zl_clean_taskq,
- (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) == NULL)
+ (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) == 0)
zil_itxg_clean(clean_me);
}