/*
* Common DEBUG functionality.
*/
+#define __printflike(a, b) __printf(a, b)
+
int spl_panic(const char *file, const char *func, int line,
const char *fmt, ...);
void spl_dumpstack(void);
extern void spa_history_log_version(spa_t *spa, const char *operation,
dmu_tx_t *tx);
extern void spa_history_log_internal(spa_t *spa, const char *operation,
- dmu_tx_t *tx, const char *fmt, ...);
+ dmu_tx_t *tx, const char *fmt, ...) __printflike(4, 5);
extern void spa_history_log_internal_ds(struct dsl_dataset *ds, const char *op,
- dmu_tx_t *tx, const char *fmt, ...);
+ dmu_tx_t *tx, const char *fmt, ...) __printflike(4, 5);
extern void spa_history_log_internal_dd(dsl_dir_t *dd, const char *operation,
- dmu_tx_t *tx, const char *fmt, ...);
+ dmu_tx_t *tx, const char *fmt, ...) __printflike(4, 5);
extern const char *spa_state_to_name(spa_t *spa);
#include <assert.h>
+#ifndef __printflike
+#define __printflike(x, y) __attribute__((__format__(__printf__, x, y)))
+#endif
+
#endif
mutex_exit(&ds->ds_lock);
}
- spa_history_log_internal_ds(ds, "create", tx, "");
+ spa_history_log_internal_ds(ds, "create", tx, " ");
zvol_create_minors(spa, doca->doca_name, B_TRUE);
dsl_dataset_rele_flags(ds, DS_HOLD_FLAG_DECRYPT, FTAG);
VERIFY0(dsl_dataset_hold_obj(pdd->dd_pool, obj, FTAG, &ds));
dsl_dataset_name(origin, namebuf);
spa_history_log_internal_ds(ds, "clone", tx,
- "origin=%s (%llu)", namebuf, origin->ds_object);
+ "origin=%s (%llu)", namebuf, (u_longlong_t)origin->ds_object);
zvol_create_minors(dp->dp_spa, doca->doca_clone, B_TRUE);
dsl_dataset_rele(ds, FTAG);
dsl_dataset_rele(origin, FTAG);
drba->drba_cookie->drc_ds = newds;
- spa_history_log_internal_ds(newds, "receive", tx, "");
+ spa_history_log_internal_ds(newds, "receive", tx, " ");
}
static int
drba->drba_cookie->drc_ds = ds;
- spa_history_log_internal_ds(ds, "resume receive", tx, "");
+ spa_history_log_internal_ds(ds, "resume receive", tx, " ");
}
/*
dsl_dir_snap_cmtime_update(ds->ds_dir);
- spa_history_log_internal_ds(ds->ds_prev, "snapshot", tx, "");
+ spa_history_log_internal_ds(ds->ds_prev, "snapshot", tx, " ");
}
void
dsl_dir_remove_livelist(origin_ds->ds_dir, tx, B_TRUE);
/* log history record */
- spa_history_log_internal_ds(hds, "promote", tx, "");
+ spa_history_log_internal_ds(hds, "promote", tx, " ");
dsl_dir_rele(odd, FTAG);
promote_rele(ddpa, FTAG);
ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS);
dmu_buf_will_dirty(ds->ds_dbuf, tx);
dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_DEFER_DESTROY;
- spa_history_log_internal_ds(ds, "defer_destroy", tx, "");
+ spa_history_log_internal_ds(ds, "defer_destroy", tx, " ");
return;
}
ASSERT3U(dsl_dataset_phys(ds)->ds_num_children, <=, 1);
/* We need to log before removing it from the namespace. */
- spa_history_log_internal_ds(ds, "destroy", tx, "");
+ spa_history_log_internal_ds(ds, "destroy", tx, " ");
dsl_scan_ds_destroyed(ds, tx);
ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock));
/* We need to log before removing it from the namespace. */
- spa_history_log_internal_ds(ds, "destroy", tx, "");
+ spa_history_log_internal_ds(ds, "destroy", tx, " ");
rmorigin = (dsl_dir_is_clone(ds->ds_dir) &&
DS_IS_DEFER_DESTROY(ds->ds_prev) &&
dmu_buf_will_dirty(ds->ds_dbuf, tx);
dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_INCONSISTENT;
- spa_history_log_internal_ds(ds, "destroy begin", tx, "");
+ spa_history_log_internal_ds(ds, "destroy begin", tx, " ");
dsl_dataset_rele(ds, FTAG);
}
spa_history_log_internal(spa, "scan setup", tx,
"func=%u mintxg=%llu maxtxg=%llu",
- *funcp, scn->scn_phys.scn_min_txg, scn->scn_phys.scn_max_txg);
+ *funcp, (u_longlong_t)scn->scn_phys.scn_min_txg,
+ (u_longlong_t)scn->scn_phys.scn_max_txg);
}
/*
if (dsl_scan_restarting(scn, tx))
spa_history_log_internal(spa, "scan aborted, restarting", tx,
- "errors=%llu", spa_get_errlog_size(spa));
+ "errors=%llu", (u_longlong_t)spa_get_errlog_size(spa));
else if (!complete)
spa_history_log_internal(spa, "scan cancelled", tx,
- "errors=%llu", spa_get_errlog_size(spa));
+ "errors=%llu", (u_longlong_t)spa_get_errlog_size(spa));
else
spa_history_log_internal(spa, "scan done", tx,
- "errors=%llu", spa_get_errlog_size(spa));
+ "errors=%llu", (u_longlong_t)spa_get_errlog_size(spa));
if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) {
spa->spa_scrub_started = B_FALSE;
if (resilver_needed) {
spa_history_log_internal(spa,
"starting deferred resilver", tx,
- "errors=%llu", spa_get_errlog_size(spa));
+ "errors=%llu",
+ (u_longlong_t)spa_get_errlog_size(spa));
spa_async_request(spa, SPA_ASYNC_RESILVER);
}
}
spa_history_log_internal_ds(ds, "hold", tx,
"tag=%s temp=%d refs=%llu",
- htag, minor != 0, ds->ds_userrefs);
+ htag, minor != 0, (u_longlong_t)ds->ds_userrefs);
}
typedef struct zfs_hold_cleanup_arg {
spa_config_exit(spa, SCL_STATE, FTAG);
spa_history_log_internal(spa, "guid change", tx, "old=%llu new=%llu",
- oldguid, *newguid);
+ (u_longlong_t)oldguid, (u_longlong_t)*newguid);
}
/*
if (new_space != old_space) {
spa_history_log_internal(spa, "vdev online", NULL,
"pool '%s' size: %llu(+%llu)",
- spa_name(spa), new_space, new_space - old_space);
+ spa_name(spa), (u_longlong_t)new_space,
+ (u_longlong_t)(new_space - old_space));
}
}
spa->spa_uberblock.ub_version = version;
vdev_config_dirty(spa->spa_root_vdev);
- spa_history_log_internal(spa, "set", tx, "version=%lld", version);
+ spa_history_log_internal(spa, "set", tx, "version=%lld",
+ (longlong_t)version);
}
/*
spa->spa_pool_props_object, propname,
8, 1, &intval, tx));
spa_history_log_internal(spa, "set", tx,
- "%s=%lld", nvpair_name(elem), intval);
+ "%s=%lld", nvpair_name(elem),
+ (longlong_t)intval);
} else {
ASSERT(0); /* not allowed */
}
spa_feature_incr(spa, SPA_FEATURE_POOL_CHECKPOINT, tx);
spa_history_log_internal(spa, "spa checkpoint", tx,
- "checkpointed uberblock txg=%llu", checkpoint.ub_txg);
+ "checkpointed uberblock txg=%llu", (u_longlong_t)checkpoint.ub_txg);
}
/*
vic->vic_mapping_object);
spa_history_log_internal(spa, "vdev remove started", tx,
- "%s vdev %llu %s", spa_name(spa), vd->vdev_id,
+ "%s vdev %llu %s", spa_name(spa), (u_longlong_t)vd->vdev_id,
(vd->vdev_path != NULL) ? vd->vdev_path : "-");
/*
* Setting spa_vdev_removal causes subsequent frees to call
spa_finish_removal(dmu_tx_pool(tx)->dp_spa, DSS_FINISHED, tx);
/* vd->vdev_path is not available here */
spa_history_log_internal(spa, "vdev remove completed", tx,
- "%s vdev %llu", spa_name(spa), vd->vdev_id);
+ "%s vdev %llu", spa_name(spa), (u_longlong_t)vd->vdev_id);
}
static void
vd->vdev_id, dmu_tx_get_txg(tx));
spa_history_log_internal(spa, "vdev remove canceled", tx,
"%s vdev %llu %s", spa_name(spa),
- vd->vdev_id, (vd->vdev_path != NULL) ? vd->vdev_path : "-");
+ (u_longlong_t)vd->vdev_id,
+ (vd->vdev_path != NULL) ? vd->vdev_path : "-");
}
static int