summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sys/spa_impl.h1
-rw-r--r--module/os/linux/zfs/spa_misc_os.c6
-rw-r--r--module/zfs/spa_history.c18
-rw-r--r--tests/zfs-tests/tests/functional/history/history_common.kshlib11
4 files changed, 21 insertions, 15 deletions
diff --git a/include/sys/spa_impl.h b/include/sys/spa_impl.h
index 02cb48057..e8806dda9 100644
--- a/include/sys/spa_impl.h
+++ b/include/sys/spa_impl.h
@@ -447,6 +447,7 @@ extern void spa_event_post(sysevent_t *ev);
extern int param_set_deadman_failmode_common(const char *val);
extern void spa_set_deadman_synctime(hrtime_t ns);
extern void spa_set_deadman_ziotime(hrtime_t ns);
+extern const char *spa_history_zone(void);
#ifdef __cplusplus
}
diff --git a/module/os/linux/zfs/spa_misc_os.c b/module/os/linux/zfs/spa_misc_os.c
index 85de10d40..5672cd6d5 100644
--- a/module/os/linux/zfs/spa_misc_os.c
+++ b/module/os/linux/zfs/spa_misc_os.c
@@ -102,3 +102,9 @@ param_set_slop_shift(const char *buf, zfs_kernel_param_t *kp)
return (0);
}
+
+const char *
+spa_history_zone(void)
+{
+ return ("linux");
+}
diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c
index 67847b6d1..f47adb94d 100644
--- a/module/zfs/spa_history.c
+++ b/module/zfs/spa_history.c
@@ -180,16 +180,6 @@ spa_history_write(spa_t *spa, void *buf, uint64_t len, spa_history_phys_t *shpp,
return (0);
}
-static char *
-spa_history_zone(void)
-{
-#ifdef _KERNEL
- return ("linux");
-#else
- return (NULL);
-#endif
-}
-
/*
* Post a history sysevent.
*
@@ -622,6 +612,14 @@ spa_history_log_version(spa_t *spa, const char *operation, dmu_tx_t *tx)
u->nodename, u->release, u->version, u->machine);
}
+#ifndef _KERNEL
+const char *
+spa_history_zone(void)
+{
+ return (NULL);
+}
+#endif
+
#if defined(_KERNEL)
EXPORT_SYMBOL(spa_history_create_obj);
EXPORT_SYMBOL(spa_history_get);
diff --git a/tests/zfs-tests/tests/functional/history/history_common.kshlib b/tests/zfs-tests/tests/functional/history/history_common.kshlib
index b82c60cbb..40daaa4d6 100644
--- a/tests/zfs-tests/tests/functional/history/history_common.kshlib
+++ b/tests/zfs-tests/tests/functional/history/history_common.kshlib
@@ -51,11 +51,11 @@ function run_and_verify
fullcmd="$1"
flags="$2"
- if is_linux; then
+ if is_illumos; then
+ histcmd=$(echo $fullcmd | sed 's/\/usr\/sbin\///g')
+ else
histcmd=$(echo $fullcmd | sed 's/^.*\/\(zpool .*\).*$/\1/')
histcmd=$(echo $histcmd | sed 's/^.*\/\(zfs .*\).*$/\1/')
- else
- histcmd=$(echo $fullcmd | sed 's/\/usr\/sbin\///g')
fi
cmd=$(echo $histcmd | awk '{print $1}')
@@ -112,10 +112,11 @@ function verify_long
typeset suffix=""
if is_linux; then
suffix=":linux"
+ elif is_freebsd; then
+ suffix=":freebsd"
fi
- grep "$cmd \[user $uid ($user) on $hname$suffix\]" \
- $NEW_HISTORY >/dev/null 2>&1
+ grep -q "$cmd \[user $uid ($user) on $hname$suffix\]" $NEW_HISTORY
if [[ $? != 0 ]]; then
log_note "Couldn't find long information for \"$cmd\""
return 1