bda88d07d9
7431 ZFS Channel Programs illumos/illumos-gate@dfc115332cdfc115332c
https://www.illumos.org/issues/7431 ZFS channel programs (ZCP) adds support for performing compound ZFS administrative actions via Lua scripts in a sandboxed environment (with time and memory limits). This initial commit includes both base support for running ZCP scripts, and a small initial library of API calls which support getting properties and listing, destroying, and promoting datasets. Testing: in addition to the included unit tests, channel programs have been in use at Delphix for several months for batch destroying filesystems. The dsl_destroy_snaps_nvl() call has also been replaced with Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Approved by: Garrett D'Amore <garrett@damore.org> Author: Chris Williamson <chris.williamson@delphix.com> 8552 ZFS LUA code uses floating point math illumos/illumos-gate@916c8d8811916c8d8811
https://www.illumos.org/issues/8552 In the LUA interpreter used by "zfs program", the lua format() function accidentally includes support for '%f' and friends, which can cause compilation problems when building on platforms that don't support floating-point math in the kernel (e.g. sparc). Support for '%f' friends (%f %e %E %g %G) should be removed, since there's no way to supply a floating-point value anyway (all numbers in ZFS LUA are int64_t's). Reviewed by: Yuri Pankov <yuripv@gmx.com> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Dan McDonald <danmcd@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> 8590 memory leak in dsl_destroy_snapshots_nvl() illumos/illumos-gate@e6ab4525d1e6ab4525d1
https://www.illumos.org/issues/8590 In dsl_destroy_snapshots_nvl(), "snaps_normalized" is not freed after it is added to "arg". Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Steve Gonczi <steve.gonczi@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> FreeBSD notes: - zfs-program.8 manual page is taken almost as is from the vendor repository, no FreeBSD-ification done - fixed multiple instances of NULL being used where an integer is expected - replaced ETIME and ECHRNG with ETIMEDOUT and EDOM respectively This commit adds a modified version of Lua 5.2.4 under sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua, mirroring the upstream. See README.zfs in that directory for the description of Lua customizations. See zfs-program.8 on how to use the new feature. MFC after: 5 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12528
124 lines
2.8 KiB
Makefile
124 lines
2.8 KiB
Makefile
# $FreeBSD$
|
|
|
|
SYSDIR?=${SRCTOP}/sys
|
|
|
|
KMOD= zfs
|
|
|
|
SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
|
|
|
|
SUNW= ${SYSDIR}/cddl/contrib/opensolaris
|
|
|
|
.PATH: ${SUNW}/common/acl
|
|
SRCS+= acl_common.c
|
|
.PATH: ${SUNW}/common/avl
|
|
SRCS+= avl.c
|
|
.PATH: ${SUNW}/common/nvpair
|
|
SRCS+= opensolaris_nvpair.c
|
|
SRCS+= opensolaris_nvpair_alloc_fixed.c
|
|
SRCS+= opensolaris_fnvpair.c
|
|
.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode
|
|
SRCS+= u8_textprep.c
|
|
|
|
.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
|
|
SRCS+= opensolaris_acl.c
|
|
SRCS+= opensolaris_dtrace.c
|
|
SRCS+= opensolaris_kobj.c
|
|
SRCS+= opensolaris_kstat.c
|
|
SRCS+= opensolaris_lookup.c
|
|
SRCS+= opensolaris_policy.c
|
|
SRCS+= opensolaris_string.c
|
|
SRCS+= opensolaris_sysevent.c
|
|
SRCS+= opensolaris_taskq.c
|
|
SRCS+= opensolaris_uio.c
|
|
SRCS+= opensolaris_vfs.c
|
|
SRCS+= opensolaris_vm.c
|
|
SRCS+= opensolaris_zone.c
|
|
|
|
_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
|
|
.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
|
|
.PATH: ${_A}/${MACHINE_CPUARCH}
|
|
SRCS+= opensolaris_atomic.S
|
|
.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
|
|
.PATH: ${_A}/${MACHINE_ARCH}
|
|
SRCS+= opensolaris_atomic.S
|
|
.else
|
|
SRCS+= opensolaris_atomic.c
|
|
.endif
|
|
|
|
.PATH: ${SUNW}/uts/common/fs
|
|
SRCS+= vnode.c
|
|
|
|
.PATH: ${SUNW}/uts/common/os
|
|
SRCS+= callb.c
|
|
SRCS+= fm.c
|
|
SRCS+= list.c
|
|
SRCS+= nvpair_alloc_system.c
|
|
|
|
.PATH: ${SUNW}/uts/common/zmod
|
|
SRCS+= adler32.c
|
|
SRCS+= opensolaris_crc32.c
|
|
SRCS+= deflate.c
|
|
SRCS+= inffast.c
|
|
SRCS+= inflate.c
|
|
SRCS+= inftrees.c
|
|
SRCS+= trees.c
|
|
SRCS+= zmod.c
|
|
SRCS+= zmod_subr.c
|
|
SRCS+= zutil.c
|
|
|
|
.PATH: ${SYSDIR}/crypto/sha2
|
|
SRCS+= sha256c.c sha512c.c
|
|
|
|
.PATH: ${SYSDIR}/crypto/skein
|
|
SRCS+= skein.c skein_block.c
|
|
|
|
.PATH: ${SUNW}/common/zfs
|
|
.include "${SUNW}/uts/common/Makefile.files"
|
|
.PATH: ${SUNW}/uts/common/fs/zfs
|
|
ZFS_SRCS= ${ZFS_OBJS:C/.o$/.c/}
|
|
SRCS+= ${ZFS_SRCS}
|
|
SRCS+= vdev_geom.c
|
|
SRCS+= trim_map.c
|
|
.PATH: ${SUNW}/uts/common/fs/zfs/lua
|
|
LUA_SRCS= ${LUA_OBJS:C/.o$/.c/}
|
|
SRCS+= ${LUA_SRCS}
|
|
|
|
# Use FreeBSD's namecache.
|
|
CFLAGS+=-DFREEBSD_NAMECACHE
|
|
|
|
CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris
|
|
CFLAGS+=-I${SUNW}/uts/common/fs/zfs
|
|
CFLAGS+=-I${SUNW}/uts/common/fs/zfs/lua
|
|
CFLAGS+=-I${SUNW}/uts/common/zmod
|
|
CFLAGS+=-I${SUNW}/uts/common
|
|
CFLAGS+=-I${SYSDIR}
|
|
CFLAGS+=-I${SUNW}/common/zfs
|
|
CFLAGS+=-I${SUNW}/common
|
|
CFLAGS+=-DBUILDING_ZFS
|
|
|
|
.if ${MACHINE_ARCH} == "powerpc64"
|
|
CFLAGS.gcc+=-mminimal-toc
|
|
.endif
|
|
|
|
.ifdef ZFS_DEBUG
|
|
CFLAGS+=-DDEBUG=1
|
|
DEBUG_FLAGS=-g
|
|
.endif
|
|
|
|
.include <bsd.kmod.mk>
|
|
|
|
CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
|
|
|
|
CWARNFLAGS+=-Wno-missing-prototypes
|
|
CWARNFLAGS+=-Wno-undef
|
|
CWARNFLAGS+=-Wno-strict-prototypes
|
|
CWARNFLAGS+=-Wno-cast-qual
|
|
CWARNFLAGS+=-Wno-parentheses
|
|
CWARNFLAGS+=-Wno-redundant-decls
|
|
CWARNFLAGS+=-Wno-missing-braces
|
|
CWARNFLAGS+=-Wno-uninitialized
|
|
CWARNFLAGS+=-Wno-unused
|
|
CWARNFLAGS+=-Wno-inline
|
|
CWARNFLAGS+=-Wno-switch
|
|
CWARNFLAGS+=-Wno-pointer-arith
|