Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2019 11:44:40 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355285 - in stable/12: cddl/lib/libzpool stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/lz4 ...
Message-ID:  <201912021144.xB2BieqZ054262@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Mon Dec  2 11:44:39 2019
New Revision: 355285
URL: https://svnweb.freebsd.org/changeset/base/355285

Log:
  MFC r354253, r354254, r354264, r354265
  Remove duplicate lz4 implementations
  
  Port illumos change: https://www.illumos.org/issues/11667
  
  Move lz4.c out of zfs tree to opensolaris/common/lz4, adjust it to be
  usable from kernel/stand/userland builds, so we can use just one single
  source. Add lz4.h to declare lz4_compress() and lz4_decompress().
  
  Differential Revision:	https://reviews.freebsd.org/D22037

Added:
  stable/12/sys/cddl/contrib/opensolaris/common/lz4/
     - copied from r354265, head/sys/cddl/contrib/opensolaris/common/lz4/
Deleted:
  stable/12/sys/cddl/boot/zfs/lz4.c
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
Modified:
  stable/12/cddl/lib/libzpool/Makefile
  stable/12/stand/efi/boot1/Makefile
  stable/12/stand/i386/gptzfsboot/Makefile
  stable/12/stand/i386/zfsboot/Makefile
  stable/12/stand/libsa/Makefile
  stable/12/stand/libsa/zfs/Makefile.inc
  stable/12/sys/cddl/boot/zfs/zfssubr.c
  stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
  stable/12/sys/conf/files
  stable/12/sys/conf/kern.pre.mk
  stable/12/sys/modules/zfs/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/cddl/lib/libzpool/Makefile
==============================================================================
--- stable/12/cddl/lib/libzpool/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/cddl/lib/libzpool/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -8,6 +8,8 @@
 .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
 # ZFS_SHARED_SRCS
 .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
+# LZ4_COMMON_SRCS
+.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
 # KERNEL_SRCS
 .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common
 # LIST_SRCS
@@ -32,6 +34,7 @@ LIB=		zpool
 
 ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c
 ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
+LZ4_COMMON_SRCS= lz4.c
 LUA_SRCS=	${LUA_OBJS:C/.o$/.c/}
 KERNEL_SRCS=	kernel.c taskq.c util.c
 LIST_SRCS=	list.c
@@ -39,7 +42,7 @@ UNICODE_SRCS=	u8_textprep.c
 LIBCMDUTILS_SRCS=nicenum.c
 
 SRCS=		${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} ${LUA_SRCS} \
-		${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \
+		${LZ4_COMMON_SRCS} ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \
 		${UNICODE_SRCS} ${LIBCMDUTILS_SRCS}
 
 WARNS?=		0
@@ -50,6 +53,7 @@ CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libz
 CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
 CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
 CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
+CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
 CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common
 CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/head
 CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair
@@ -61,6 +65,8 @@ CFLAGS+=	-DWANTS_MUTEX_OWNED
 CFLAGS+=	-I${SRCTOP}/lib/libpthread/thread
 CFLAGS+=	-I${SRCTOP}/lib/libpthread/sys
 CFLAGS+=	-I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include
+CFLAGS.lz4.o+=	-D_FAKE_KERNEL
+CFLAGS.lz4.pico+= -D_FAKE_KERNEL
 CFLAGS.gcc+=	-fms-extensions
 
 LIBADD=		md pthread z nvpair avl umem

Modified: stable/12/stand/efi/boot1/Makefile
==============================================================================
--- stable/12/stand/efi/boot1/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/stand/efi/boot1/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -37,6 +37,7 @@ CFLAGS.zfs_module.c+=	-I${ZFSSRC}
 CFLAGS.zfs_module.c+=	-I${SYSDIR}/cddl/boot/zfs
 CFLAGS.zfs_module.c+=	-I${SYSDIR}/crypto/skein
 CFLAGS.zfs_module.c+=	-I${SYSDIR}/cddl/contrib/opensolaris/uts/common
+CFLAGS.zfs_module.c+=	-I${SYSDIR}/cddl/contrib/opensolaris/common/lz4
 
 CFLAGS+=	-DEFI_ZFS_BOOT
 .endif

Modified: stable/12/stand/i386/gptzfsboot/Makefile
==============================================================================
--- stable/12/stand/i386/gptzfsboot/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/stand/i386/gptzfsboot/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -29,6 +29,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
 	-I${SYSDIR}/crypto/skein \
 	-I${SYSDIR}/cddl/boot/zfs \
 	-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+	-I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \
 	-I${BOOTSRC}/i386/btx/lib \
 	-I${BOOTSRC}/i386/boot2 \
 	-Wall -Waggregate-return -Wbad-function-cast \

Modified: stable/12/stand/i386/zfsboot/Makefile
==============================================================================
--- stable/12/stand/i386/zfsboot/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/stand/i386/zfsboot/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -28,6 +28,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \
 	-I${SYSDIR}/crypto/skein \
 	-I${SYSDIR}/cddl/boot/zfs \
 	-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+	-I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \
 	-I${BOOTSRC}/i386/boot2 \
 	-Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
 	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \

Modified: stable/12/stand/libsa/Makefile
==============================================================================
--- stable/12/stand/libsa/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/stand/libsa/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -102,6 +102,11 @@ CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
 SRCS+=	adler32.c crc32.c
 SRCS+=	infback.c inffast.c inflate.c inftrees.c zutil.c
 
+# lz4 decompression functionality
+.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+SRCS+=	lz4.c
+CFLAGS.lz4.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+
 # Create a subset of includes that are safe, as well as adjusting those that aren't
 # The lists may drive people nuts, but they are explicitly opt-in
 FAKE_DIRS=xlocale arpa

Modified: stable/12/stand/libsa/zfs/Makefile.inc
==============================================================================
--- stable/12/stand/libsa/zfs/Makefile.inc	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/stand/libsa/zfs/Makefile.inc	Mon Dec  2 11:44:39 2019	(r355285)
@@ -12,4 +12,6 @@ CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
 CFLAGS+=	-I${SYSDIR}/cddl/contrib/opensolaris/uts/common
 CFLAGS+=	-I${SYSDIR}/crypto/skein
 
+CFLAGS.zfs.c+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+
 CFLAGS+=	-Wformat -Wall

Modified: stable/12/sys/cddl/boot/zfs/zfssubr.c
==============================================================================
--- stable/12/sys/cddl/boot/zfs/zfssubr.c	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/sys/cddl/boot/zfs/zfssubr.c	Mon Dec  2 11:44:39 2019	(r355285)
@@ -26,6 +26,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <lz4.h>
+
 static uint64_t zfs_crc64_table[256];
 
 #define	ECKSUM	666
@@ -161,7 +163,6 @@ typedef struct zio_compress_info {
 
 #include "lzjb.c"
 #include "zle.c"
-#include "lz4.c"
 
 /*
  * Compression vectors.

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files	Mon Dec  2 11:44:39 2019	(r355285)
@@ -98,7 +98,6 @@ ZFS_COMMON_OBJS +=		\
 	dsl_scan.o		\
 	zfeature.o		\
 	gzip.o			\
-	lz4.o			\
 	lzjb.o			\
 	metaslab.o		\
 	multilist.o		\

Modified: stable/12/sys/conf/files
==============================================================================
--- stable/12/sys/conf/files	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/sys/conf/files	Mon Dec  2 11:44:39 2019	(r355285)
@@ -139,6 +139,7 @@ cddl/compat/opensolaris/kern/opensolaris_vm.c				optio
 cddl/compat/opensolaris/kern/opensolaris_zone.c				optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/acl/acl_common.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/avl/avl.c				optional zfs compile-with "${ZFS_C}"
+cddl/contrib/opensolaris/lz4/lz4.c					optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c	optional zfs compile-with "${ZFS_C}"
@@ -189,7 +190,6 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c		optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c			optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c			optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c			optional zfs compile-with "${ZFS_C}"

Modified: stable/12/sys/conf/kern.pre.mk
==============================================================================
--- stable/12/sys/conf/kern.pre.mk	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/sys/conf/kern.pre.mk	Mon Dec  2 11:44:39 2019	(r355285)
@@ -163,6 +163,7 @@ CDDL_C=		${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.
 ZFS_CFLAGS=	-DBUILDING_ZFS -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs
 ZFS_CFLAGS+=	-I$S/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
 ZFS_CFLAGS+=	-I$S/cddl/contrib/opensolaris/uts/common/zmod
+ZFS_CFLAGS+=	-I$S/cddl/contrib/opensolaris/common/lz4
 ZFS_CFLAGS+=	-I$S/cddl/contrib/opensolaris/common/zfs
 ZFS_CFLAGS+=	${CDDL_CFLAGS}
 ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS}

Modified: stable/12/sys/modules/zfs/Makefile
==============================================================================
--- stable/12/sys/modules/zfs/Makefile	Mon Dec  2 09:57:07 2019	(r355284)
+++ stable/12/sys/modules/zfs/Makefile	Mon Dec  2 11:44:39 2019	(r355285)
@@ -18,6 +18,8 @@ SRCS+=	opensolaris_nvpair_alloc_fixed.c
 SRCS+=	opensolaris_fnvpair.c
 .PATH:	${SYSDIR}/cddl/contrib/opensolaris/common/unicode
 SRCS+=	u8_textprep.c
+.PATH:	${SUNW}/common/lz4
+SRCS+=	lz4.c
 
 .PATH:	${SYSDIR}/cddl/compat/opensolaris/kern
 SRCS+=	opensolaris_acl.c
@@ -93,6 +95,7 @@ CFLAGS+=-I${SUNW}/uts/common/zmod
 CFLAGS+=-I${SUNW}/uts/common
 CFLAGS+=-I${SYSDIR}
 CFLAGS+=-I${SUNW}/common/zfs
+CFLAGS+=-I${SUNW}/common/lz4
 CFLAGS+=-I${SUNW}/common
 CFLAGS+=-DBUILDING_ZFS
 CFLAGS.gcc+=-fms-extensions



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912021144.xB2BieqZ054262>