git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Illumos #3552, #3564
[zfs.git]
/
module
/
zfs
/
spa_history.c
diff --git
a/module/zfs/spa_history.c
b/module/zfs/spa_history.c
index
ce7d378
..
9fb75f3
100644
(file)
--- a/
module/zfs/spa_history.c
+++ b/
module/zfs/spa_history.c
@@
-21,6
+21,7
@@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 by Delphix. All rights reserved.
*/
#include <sys/spa.h>
*/
#include <sys/spa.h>
@@
-101,11
+102,11
@@
spa_history_create_obj(spa_t *spa, dmu_tx_t *tx)
/*
* Figure out maximum size of history log. We set it at
/*
* Figure out maximum size of history log. We set it at
- *
1% of pool size, with a max of 32MB
and min of 128KB.
+ *
0.1% of pool size, with a max of 1G
and min of 128KB.
*/
shpp->sh_phys_max_off =
*/
shpp->sh_phys_max_off =
- metaslab_class_get_dspace(spa_normal_class(spa)) / 100;
- shpp->sh_phys_max_off = MIN(shpp->sh_phys_max_off,
32<<2
0);
+ metaslab_class_get_dspace(spa_normal_class(spa)) / 100
0
;
+ shpp->sh_phys_max_off = MIN(shpp->sh_phys_max_off,
1<<3
0);
shpp->sh_phys_max_off = MAX(shpp->sh_phys_max_off, 128<<10);
dmu_buf_rele(dbp, FTAG);
shpp->sh_phys_max_off = MAX(shpp->sh_phys_max_off, 128<<10);
dmu_buf_rele(dbp, FTAG);
@@
-178,7
+179,11
@@
static char *
spa_history_zone(void)
{
#ifdef _KERNEL
spa_history_zone(void)
{
#ifdef _KERNEL
+#ifdef HAVE_SPL
+ return ("linux");
+#else
return (curproc->p_zone->zone_name);
return (curproc->p_zone->zone_name);
+#endif
#else
return ("global");
#endif
#else
return ("global");
#endif
@@
-229,7
+234,7
@@
spa_history_log_sync(void *arg1, void *arg2, dmu_tx_t *tx)
}
#endif
}
#endif
- VERIFY(nvlist_alloc(&nvrecord, NV_UNIQUE_NAME, KM_
SLEEP
) == 0);
+ VERIFY(nvlist_alloc(&nvrecord, NV_UNIQUE_NAME, KM_
PUSHPAGE
) == 0);
VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_TIME,
gethrestime_sec()) == 0);
VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_WHO, hap->ha_uid) == 0);
VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_TIME,
gethrestime_sec()) == 0);
VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_WHO, hap->ha_uid) == 0);
@@
-261,10
+266,10
@@
spa_history_log_sync(void *arg1, void *arg2, dmu_tx_t *tx)
}
VERIFY(nvlist_size(nvrecord, &reclen, NV_ENCODE_XDR) == 0);
}
VERIFY(nvlist_size(nvrecord, &reclen, NV_ENCODE_XDR) == 0);
- record_packed = kmem_alloc(reclen, KM_
SLEEP
);
+ record_packed = kmem_alloc(reclen, KM_
PUSHPAGE
);
VERIFY(nvlist_pack(nvrecord, &record_packed, &reclen,
VERIFY(nvlist_pack(nvrecord, &record_packed, &reclen,
- NV_ENCODE_XDR, KM_
SLEEP
) == 0);
+ NV_ENCODE_XDR, KM_
PUSHPAGE
) == 0);
mutex_enter(&spa->spa_history_lock);
if (hap->ha_log_type == LOG_CMD_POOL_CREATE)
mutex_enter(&spa->spa_history_lock);
if (hap->ha_log_type == LOG_CMD_POOL_CREATE)
@@
-311,7
+316,7
@@
spa_history_log(spa_t *spa, const char *history_str, history_log_type_t what)
return (err);
}
return (err);
}
- ha = kmem_alloc(sizeof (history_arg_t), KM_
SLEEP
);
+ ha = kmem_alloc(sizeof (history_arg_t), KM_
PUSHPAGE
);
ha->ha_history_str = strdup(history_str);
ha->ha_zone = strdup(spa_history_zone());
ha->ha_log_type = what;
ha->ha_history_str = strdup(history_str);
ha->ha_zone = strdup(spa_history_zone());
ha->ha_log_type = what;
@@
-437,7
+442,7
@@
log_internal(history_internal_events_t event, spa_t *spa,
if (tx->tx_txg == TXG_INITIAL)
return;
if (tx->tx_txg == TXG_INITIAL)
return;
- ha = kmem_alloc(sizeof (history_arg_t), KM_
SLEEP
);
+ ha = kmem_alloc(sizeof (history_arg_t), KM_
PUSHPAGE
);
va_copy(adx_copy, adx);
ha->ha_history_str = kmem_vasprintf(fmt, adx_copy);
va_end(adx_copy);
va_copy(adx_copy, adx);
ha->ha_history_str = kmem_vasprintf(fmt, adx_copy);
va_end(adx_copy);
@@
-499,3
+504,11
@@
spa_history_log_version(spa_t *spa, history_internal_events_t event)
(u_longlong_t)current_vers, spa_name(spa), SPA_VERSION);
#endif
}
(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