X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fspa_history.c;h=243f2b4ab370e83ca5bad8d19a6848c5a551b467;hb=3558fd73b5d863304102f6745c26e0b592aca60a;hp=212abae5b80c62dcd1e228957fa515eacd0e5faf;hpb=428870ff734fdaccc342b33fc53cf94724409a46;p=zfs.git diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c index 212abae..243f2b4 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -175,10 +175,14 @@ spa_history_write(spa_t *spa, void *buf, uint64_t len, spa_history_phys_t *shpp, } static char * -spa_history_zone() +spa_history_zone(void) { #ifdef _KERNEL +#ifdef HAVE_SPL + return ("linux"); +#else return (curproc->p_zone->zone_name); +#endif #else return ("global"); #endif @@ -428,6 +432,7 @@ log_internal(history_internal_events_t event, spa_t *spa, dmu_tx_t *tx, const char *fmt, va_list adx) { history_arg_t *ha; + va_list adx_copy; /* * If this is part of creating a pool, not everything is @@ -437,11 +442,9 @@ log_internal(history_internal_events_t event, spa_t *spa, return; ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP); - ha->ha_history_str = kmem_alloc(vsnprintf(NULL, 0, fmt, adx) + 1, - KM_SLEEP); - - (void) vsprintf(ha->ha_history_str, fmt, adx); - + va_copy(adx_copy, adx); + ha->ha_history_str = kmem_vasprintf(fmt, adx_copy); + va_end(adx_copy); ha->ha_log_type = LOG_INTERNAL; ha->ha_event = event; ha->ha_zone = NULL; @@ -500,3 +503,11 @@ spa_history_log_version(spa_t *spa, history_internal_events_t event) (u_longlong_t)current_vers, spa_name(spa), SPA_VERSION); #endif } + +#if defined(_KERNEL) && defined(HAVE_SPL) +EXPORT_SYMBOL(spa_history_create_obj); +EXPORT_SYMBOL(spa_history_get); +EXPORT_SYMBOL(spa_history_log); +EXPORT_SYMBOL(spa_history_log_internal); +EXPORT_SYMBOL(spa_history_log_version); +#endif