From d99a015343425a1c856c900aa8223016400ac2dc Mon Sep 17 00:00:00 2001 From: Chris Williamson Date: Thu, 8 Feb 2018 09:16:23 -0700 Subject: OpenZFS 7431 - ZFS Channel Programs Authored by: Chris Williamson Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: John Kennedy Reviewed by: Dan Kimmel Approved by: Garrett D'Amore Ported-by: Don Brady Ported-by: John Kennedy OpenZFS-issue: https://www.illumos.org/issues/7431 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/dfc11533 Porting Notes: * The CLI long option arguments for '-t' and '-m' don't parse on linux * Switched from kmem_alloc to vmem_alloc in zcp_lua_alloc * Lua implementation is built as its own module (zlua.ko) * Lua headers consumed directly by zfs code moved to 'include/sys/lua/' * There is no native setjmp/longjump available in stock Linux kernel. Brought over implementations from illumos and FreeBSD * The get_temporary_prop() was adapted due to VFS platform differences * Use of inline functions in lua parser to reduce stack usage per C call * Skip some ZFS Test Suite ZCP tests on sparc64 to avoid stack overflow --- scripts/Makefile.am | 1 + scripts/dkms.mkconf | 3 +++ scripts/zfs.sh | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7b2374a82..65d7d6662 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -42,6 +42,7 @@ export KMOD_ZAVL=@abs_top_builddir@/module/avl/zavl.ko export KMOD_ZNVPAIR=@abs_top_builddir@/module/nvpair/znvpair.ko export KMOD_ZUNICODE=@abs_top_builddir@/module/unicode/zunicode.ko export KMOD_ZCOMMON=@abs_top_builddir@/module/zcommon/zcommon.ko +export KMOD_ZLUA=@abs_top_builddir@/module/lua/zlua.ko export KMOD_ICP=@abs_top_builddir@/module/icp/icp.ko export KMOD_ZFS=@abs_top_builddir@/module/zfs/zfs.ko endef diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf index ab171a606..35da3b69c 100755 --- a/scripts/dkms.mkconf +++ b/scripts/dkms.mkconf @@ -91,4 +91,7 @@ DEST_MODULE_LOCATION[4]="/extra/zfs/zfs" BUILT_MODULE_NAME[5]="icp" BUILT_MODULE_LOCATION[5]="module/icp/" DEST_MODULE_LOCATION[5]="/extra/icp/icp" +BUILT_MODULE_NAME[6]="zlua" +BUILT_MODULE_LOCATION[6]="module/lua/" +DEST_MODULE_LOCATION[6]="/extra/lua/zlua" EOF diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 3cfb0c1f1..185eb5279 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -26,6 +26,7 @@ KMOD_ZAVL=${KMOD_ZAVL:-zavl} KMOD_ZNVPAIR=${KMOD_ZNVPAIR:-znvpair} KMOD_ZUNICODE=${KMOD_ZUNICODE:-zunicode} KMOD_ZCOMMON=${KMOD_ZCOMMON:-zcommon} +KMOD_ZLUA=${KMOD_ZLUA:-zlua} KMOD_ICP=${KMOD_ICP:-icp} KMOD_ZFS=${KMOD_ZFS:-zfs} @@ -76,7 +77,7 @@ check_modules() { MISSING_MODULES="" for KMOD in $KMOD_SPL $KMOD_SPLAT $KMOD_ZAVL $KMOD_ZNVPAIR \ - $KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ICP $KMOD_ZFS; do + $KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ZLUA $KMOD_ICP $KMOD_ZFS; do NAME=$(basename "$KMOD" .ko) if lsmod | grep -E -q "^${NAME}"; then @@ -135,7 +136,7 @@ load_modules() { fi for KMOD in $KMOD_SPL $KMOD_SPLAT $KMOD_ZAVL $KMOD_ZNVPAIR \ - $KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ICP $KMOD_ZFS; do + $KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ZLUA $KMOD_ICP $KMOD_ZFS; do load_module "$KMOD" || return 1 done @@ -163,7 +164,7 @@ unload_module() { } unload_modules() { - for KMOD in $KMOD_ZFS $KMOD_ICP $KMOD_ZCOMMON $KMOD_ZUNICODE \ + for KMOD in $KMOD_ZFS $KMOD_ICP $KMOD_ZLUA $KMOD_ZCOMMON $KMOD_ZUNICODE \ $KMOD_ZNVPAIR $KMOD_ZAVL $KMOD_SPLAT $KMOD_SPL; do NAME=$(basename "$KMOD" .ko) USE_COUNT=$(lsmod | grep -E "^${NAME} " | awk '{print $3}') -- cgit v1.2.3