summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/common/zfs
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-02-09 06:39:28 +0000
committerdelphij <delphij@FreeBSD.org>2013-02-09 06:39:28 +0000
commitc6d9dc1ad2d2e36220845b84a2d180bd97354797 (patch)
treec4610073af7b690ab8405c694b1d4327325f042d /sys/cddl/contrib/opensolaris/common/zfs
parenta49e0b73452f93f1ba4f9227c93f8802ac62b9e1 (diff)
parent325800a864f05404b03fe290f05f64f9ae496622 (diff)
downloadFreeBSD-src-c6d9dc1ad2d2e36220845b84a2d180bd97354797.zip
FreeBSD-src-c6d9dc1ad2d2e36220845b84a2d180bd97354797.tar.gz
MFV r245512:
* Illumos zfs issue #3035 [1] LZ4 compression support in ZFS. LZ4 is a new high-speed BSD-licensed compression algorithm created by Yann Collet that delivers very high compression and decompression performance compared to lzjb (>50% faster on compression, >80% faster on decompression and around 3x faster on compression of incompressible data), while giving better compression ratio [1]. This version of LZ4 corresponds to upstream's [2] revision 85. Please note that for obvious reasons this is not backward read compatible. This means once a pool have LZ4 compressed data, these data can no longer be read by older ZFS implementations. Local changes: - On-stack hash table disabled and using kernel slab allocator instead, at this time. This requires larger kernel thread stack for zio workers. This may change in the future should we adjusted the zio workers' thread stack size. - likely and unlikely will be undefined if they are already defined, this is required for i386 XEN build. - Removed De Bruijn sequence based __builtin_ctz family of builtins in favor of the latter. Both GCC and clang supports these builtins. - Changed the way the LZ4 code detects endianness. - Manual pages modifications to mention the feature based on Illumos counterpart. - Boot loader changes to make it support LZ4 decompression. [1] https://www.illumos.org/issues/3035 [2] http://code.google.com/p/lz4/source/list Obtained from: Illumos (13921:9d721847e469) Tested on: FreeBSD/amd64 MFC after: 1 month
Diffstat (limited to 'sys/cddl/contrib/opensolaris/common/zfs')
-rw-r--r--sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c4
-rw-r--r--sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h2
-rw-r--r--sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c6
3 files changed, 10 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c b/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
index 1a5948e..c2539d2 100644
--- a/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
+++ b/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
#ifdef _KERNEL
@@ -155,4 +156,7 @@ zpool_feature_init(void)
zfeature_register(SPA_FEATURE_EMPTY_BPOBJ,
"com.delphix:empty_bpobj", "empty_bpobj",
"Snapshots use less space.", B_TRUE, B_FALSE, NULL);
+ zfeature_register(SPA_FEATURE_LZ4_COMPRESS,
+ "org.illumos:lz4_compress", "lz4_compress",
+ "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL);
}
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h b/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
index cb786b2..3873317 100644
--- a/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
+++ b/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
#ifndef _ZFEATURE_COMMON_H
@@ -51,6 +52,7 @@ typedef int (zfeature_func_t)(zfeature_info_t *fi, void *arg);
static enum spa_feature {
SPA_FEATURE_ASYNC_DESTROY,
SPA_FEATURE_EMPTY_BPOBJ,
+ SPA_FEATURE_LZ4_COMPRESS,
SPA_FEATURES
} spa_feature_t;
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
index 5f5b8da..dc0cb33 100644
--- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
+++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -96,6 +97,7 @@ zfs_prop_init(void)
{ "gzip-8", ZIO_COMPRESS_GZIP_8 },
{ "gzip-9", ZIO_COMPRESS_GZIP_9 },
{ "zle", ZIO_COMPRESS_ZLE },
+ { "lz4", ZIO_COMPRESS_LZ4 },
{ NULL }
};
@@ -211,8 +213,8 @@ zfs_prop_init(void)
zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
- "on | off | lzjb | gzip | gzip-[1-9] | zle", "COMPRESS",
- compress_table);
+ "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
+ "COMPRESS", compress_table);
zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
"hidden | visible", "SNAPDIR", snapdir_table);
OpenPOWER on IntegriCloud