diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 468fbbb2cf..9d27a984e0 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -868,8 +868,8 @@ dump_history(spa_t *spa) (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; diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 9481d3f07a..47b360721a 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -2019,7 +2019,7 @@ ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index, 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); } /* @@ -3919,7 +3919,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id) 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); diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 197d81ccaa..a0309b8764 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -1230,7 +1230,7 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun, (void) nvlist_lookup_int64(rbi, 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 " @@ -1245,13 +1245,14 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun, (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")); } @@ -1289,7 +1290,7 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason, "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. "), @@ -1303,11 +1304,13 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason, 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) { diff --git a/module/zfs/sa.c b/module/zfs/sa.c index a91b379f99..17649274dd 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -1469,12 +1469,12 @@ sa_attr_register_sync(sa_handle_t *hdl, dmu_tx_t *tx) 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) { int error; sa->sa_reg_attr_obj = zap_create(hdl->sa_os, DMU_OT_SA_ATTR_REGISTRATION, DMU_OT_NONE, 0, tx); diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 5e4ad1aa45..fac53e3173 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -2276,7 +2276,7 @@ zfs_ioc_set_prop(zfs_cmd_t *zc) 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); } @@ -3711,7 +3711,7 @@ zfs_ioc_clear(zfs_cmd_t *zc) 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,