Skip to content

Commit 4cd7cf5

Browse files
c0d3z3r0allanjudeBrainSlayerKjeld Schouten-Lebbing
committed
Formal changes: tests, documentation, copyright
Add zstd to the test suite - add zstd to history_002_pos.ksh - add random levels of zstd to history_002_pos.ksh - add zstd-fast to history_002_pos.ksh - add random levels of zstd-fast to history_002_pos.ksh Add documentation - add man page content - add README for contrib/zstd Fixup copyright headers of touched and new files - Adds copyright headers for Allan Jude / Klara Inc. - Added Ornias1993 Copyright - Cleans copyright header formatting Co-authored-by: Allan Jude <[email protected]> Co-authored-by: Sebastian Gottschall <[email protected]> Co-authored-by: Kjeld Schouten-Lebbing <[email protected]> Co-authored-by: Michael Niewöhner <[email protected]> Signed-off-by: Allan Jude <[email protected]> Signed-off-by: Sebastian Gottschall <[email protected]> Signed-off-by: Kjeld Schouten-Lebbing <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]>
1 parent bf2f4a1 commit 4cd7cf5

File tree

23 files changed

+256
-117
lines changed

23 files changed

+256
-117
lines changed

contrib/zstd/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ZSTD Contrib Library Manual
2+
3+
## Introduction
4+
5+
This `contrib` contains the ZSTD library used in ZFS. It is heavily cut-down by
6+
dropping any unneeded files but otherwise is intentionally unmodified. Please do
7+
not alter these files in any way, besides upgrading to a newer ZSTD release.
8+
9+
## Updating ZSTD
10+
11+
To update ZSTD the following steps need to be taken:
12+
13+
1. Grab the latest release of [ZSTD](https://github.com/facebook/zstd/releases).
14+
2. Replace (not merge) `common`, `compress`, `decompress` and `zstd.h` with the
15+
new versions from `lib/`.
16+
3. Make sure any newly required files and/or folders are also included.
17+
1. Add an empty file `Makefile.am` inside any new folder.
18+
2. Add them to `AC_CONFIG_FILES` in `configure.ac` accordingly.
19+
3. Make sure new files/folders are listed in
20+
- `contrib/zstd/Makefile.am`
21+
- `lib/libzstd/Makefile.am`
22+
- `module/zstd/Makefile.in`
23+
- this README
24+
4. Update the version `ZFS_MODULE_VERSION("x.y.z")` in `module/zstd/zstd.c`.

include/sys/arc.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
*
1919
* CDDL HEADER END
2020
*/
21+
2122
/*
2223
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2012, 2016 by Delphix. All rights reserved.
24-
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
24+
* Copyright (c) 2012, 2016, Delphix. All rights reserved.
25+
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
26+
* Copyright (c) 2019, Allan Jude. All rights reserved.
27+
* Copyright (c) 2019, Klara Inc. All rights reserved.
28+
* Use is subject to license terms.
2529
*/
2630

2731
#ifndef _SYS_ARC_H

include/sys/spa.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@
1818
*
1919
* CDDL HEADER END
2020
*/
21+
2122
/*
2223
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24-
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25-
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
26-
* Copyright 2013 Saso Kiselkov. All rights reserved.
27-
* Copyright (c) 2014 Integros [integros.com]
28-
* Copyright 2017 Joyent, Inc.
29-
* Copyright (c) 2017, 2019, Datto Inc. All rights reserved.
30-
* Copyright (c) 2017, Intel Corporation.
24+
* Copyright (c) 2011, 2019, Delphix. All rights reserved.
25+
* Copyright (c) 2011, Nexenta Systems Inc. All rights reserved.
26+
* Copyright (c) 2014, Spectra Logic Corporation. All rights reserved.
27+
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
28+
* Copyright (c) 2014, Integros. All rights reserved.
29+
* Copyright (c) 2017, Joyent, Inc. All rights reserved.
30+
* Copyright (c) 2017, Datto Inc. All rights reserved.
31+
* Copyright (c) 2017, Intel Corporation. All rights reserved.
32+
* Copyright (c) 2019, Allan Jude. All rights reserved.
33+
* Copyright (c) 2019, Klara Inc. All rights reserved.
34+
* Use is subject to license terms.
3135
*/
3236

3337
#ifndef _SYS_SPA_H

include/sys/zio.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121

2222
/*
2323
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24-
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25-
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
26-
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
24+
* Copyright (c) 2011, Nexenta Systems, Inc. All rights reserved.
25+
* Copyright (c) 2012, 2018, Delphix. All rights reserved.
26+
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
2727
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
28-
* Copyright 2016 Toomas Soome <[email protected]>
28+
* Copyright (c) 2016, Toomas Soome. All rights reserved.
29+
* Copyright (c) 2019, Allan Jude. All rights reserved.
30+
* Copyright (c) 2019, Klara Inc. All rights reserved.
31+
* Use is subject to license terms.
2932
*/
3033

3134
#ifndef _ZIO_H

include/sys/zio_compress.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
*/
2121

2222
/*
23-
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23+
* Copyright (c) 2009, Sun Microsystems Inc. All rights reserved.
24+
* Copyright (c) 2015, 2016, Delphix. All rights reserved.
25+
* Copyright (c) 2019, Allan Jude. All rights reserved.
26+
* Copyright (c) 2019, Klara Inc. All rights reserved.
2427
* Use is subject to license terms.
25-
* Copyright (c) 2015, 2016 by Delphix. All rights reserved.
2628
*/
2729

2830
#ifndef _SYS_ZIO_COMPRESS_H

man/man5/zpool-features.5

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
'\" te
2-
.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
3-
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
4-
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
52
.\" The contents of this file are subject to the terms of the Common Development
63
.\" and Distribution License (the "License"). You may not use this file except
74
.\" in compliance with the License. You can obtain a copy of the license at
@@ -14,6 +11,11 @@
1411
.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
1512
.\" own identifying information:
1613
.\" Portions Copyright [yyyy] [name of copyright owner]
14+
.\" Copyright (c) 2012, 2018, Delphix. All rights reserved.
15+
.\" Copyright (c) 2013, Saso Kiselkov. All rights reserved.
16+
.\" Copyright (c) 2014, Joyent Inc. All rights reserved.
17+
.\" Copyright (c) 2019, Klara Inc. All rights reserved.
18+
.\" Copyright (c) 2019, Allan Jude. All rights reserved.
1719
.TH ZPOOL-FEATURES 5 "Jun 8, 2018"
1820
.SH NAME
1921
zpool\-features \- ZFS pool feature descriptions
@@ -926,6 +928,42 @@ This feature becomes \fBactive\fR when the \fBzpool checkpoint\fR subcommand
926928
is used to checkpoint the pool.
927929
The feature will only return back to being \fBenabled\fR when the pool
928930
is rewound or the checkpoint has been discarded.
931+
.RE
932+
933+
.sp
934+
.ne 2
935+
.na
936+
\fBzstd_compress\fR
937+
.ad
938+
.RS 4n
939+
.TS
940+
l l .
941+
GUID org.freebsd:zstd_compress
942+
READ\-ONLY COMPATIBLE no
943+
DEPENDENCIES none
944+
.TE
945+
946+
\fBzstd\fR is a high-performance compression algorithm that features a
947+
combination of high compression ratios and high speed. Compared to \fBgzip\fR,
948+
\fBzstd\fR offers slighty better compression at much higher speeds. Compared
949+
to \fBlz4\fR, \fBzstd\fR offers much better compression while being only
950+
modestly slower. Typically, \fBzstd\fR compression speed ranges from 250 to 500
951+
MB/s per thread and decompression speed is over 1 GB/s per thread.
952+
953+
When the \fBzstd\fR feature is set to \fBenabled\fR, the administrator can turn
954+
on \fBzstd\fR compression of any dataset by running
955+
`zfs set compress=zstd <pool/fs>`.
956+
957+
This feature becomes \fBactive\fR once a \fBcompress\fR property has been set to
958+
\fBzstd\fR, and will return to being \fBenabled\fR once all filesystems that
959+
have ever had their compress property set to \fBzstd\fR are destroyed.
960+
961+
Booting off of \fBzstd\fR-compressed root pools is not yet supported.
962+
963+
Sending a \fBzstd\fR dataset to a non-\fBzstd zpool\fR by \fBzfs send -e\fR is
964+
not possible and will result in an error. Either drop the \fB-e\fR option or
965+
enable \fBzstd\fR on the receiver \fBzpool\fR.
966+
.RE
929967

930968
.SH "SEE ALSO"
931969
zpool(8)

man/man8/zfsprops.8

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,22 @@
1919
.\" CDDL HEADER END
2020
.\"
2121
.\"
22-
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23-
.\" Copyright 2011 Joshua M. Clulow <[email protected]>
24-
.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25-
.\" Copyright (c) 2011, Pawel Jakub Dawidek <[email protected]>
26-
.\" Copyright (c) 2012, Glen Barber <[email protected]>
27-
.\" Copyright (c) 2012, Bryan Drewery <[email protected]>
28-
.\" Copyright (c) 2013, Steven Hartland <[email protected]>
29-
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
30-
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
31-
.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
32-
.\" Copyright (c) 2014 Integros [integros.com]
33-
.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
34-
.\" Copyright (c) 2014, Xin LI <[email protected]>
35-
.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
36-
.\" Copyright 2019 Richard Laager. All rights reserved.
37-
.\" Copyright 2018 Nexenta Systems, Inc.
38-
.\" Copyright 2019 Joyent, Inc.
22+
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
23+
.\" Copyright (c) 2011, Joshua M. Clulow. All Rights Reserved.
24+
.\" Copyright (c) 2011, 2019, Delphix. All rights reserved.
25+
.\" Copyright (c) 2011, Pawel Jakub Dawidek. All rights reserved.
26+
.\" Copyright (c) 2012, Glen Barber. All rights reserved.
27+
.\" Copyright (c) 2012, Bryan Drewery. All rights reserved.
28+
.\" Copyright (c) 2013, Steven Hartland. All rights reserved.
29+
.\" Copyright (c) 2013, Saso Kiselkov. All rights reserved.
30+
.\" Copyright (c) 2014, 2019, Joyent, Inc. All rights reserved.
31+
.\" Copyright (c) 2014, Adam Stevko. All rights reserved.
32+
.\" Copyright (c) 2014, Integros. All rights reserved.
33+
.\" Copyright (c) 2014, Xin LI. All rights reserved.
34+
.\" Copyright (c) 2014-2015, The FreeBSD Foundation. All Rights Reserved.
35+
.\" Copyright (c) 2016, 2018, Nexenta Systems, Inc. All rights reserved.
36+
.\" Copyright (c) 2019, Richard Laager. All rights reserved.
37+
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing. All rights reserved.
3938
.\"
4039
.Dd January 30, 2020
4140
.Dt ZFSPROPS 8
@@ -774,7 +773,8 @@ for more information on these algorithms.
774773
Changing this property affects only newly-written data.
775774
.It Xo
776775
.Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns
777-
.Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle
776+
.Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle Ns | Ns Sy zstd Ns | Ns
777+
.Sy zstd- Ns Em N Ns | Ns Sy zstd-fast- Ns Em N
778778
.Xc
779779
Controls the compression algorithm used for this dataset.
780780
.Pp
@@ -842,6 +842,35 @@ is equivalent to
842842
.Pc .
843843
.Pp
844844
The
845+
.Sy zstd
846+
compression using the zstd algorithm ,
847+
You can specify the
848+
.Sy zstd
849+
level by using the value
850+
.Sy zstd- Ns Em N ,
851+
where
852+
.Em N
853+
is an integer from 1
854+
.Pq fastest
855+
to 19
856+
.Pq best compression ratio .
857+
.Sy zstd
858+
You can also specify a negative
859+
.Sy zstd
860+
level by using the value
861+
.Sy zstd- Ns Em N ,
862+
where
863+
.Em N
864+
is an integer from 100
865+
.Pq fastest
866+
to 1
867+
.Pq best compression ratio .
868+
.Sy zstd
869+
is equivalent to
870+
.Sy zstd-3
871+
.Pc .
872+
.Pp
873+
The
845874
.Sy zle
846875
compression algorithm compresses runs of zeros.
847876
.Pp

module/zcommon/zfeature_common.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
*/
2121

2222
/*
23-
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
24-
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25-
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
26-
* Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
27-
* Copyright (c) 2017, Intel Corporation.
23+
* Copyright (c) 2011, 2018, Delphix. All rights reserved.
24+
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
25+
* Copyright (c) 2013, Joyent Inc. All rights reserved.
26+
* Copyright (c) 2014, Nexenta Systems Inc. All rights reserved.
27+
* Copyright (c) 2017, Intel Corporation. All rights reserved.
28+
* Copyright (c) 2019, Klara Inc. All rights reserved.
29+
* Copyright (c) 2019, Allan Jude. All rights reserved.
30+
* Use is subject to license terms.
2831
*/
2932

3033
#ifndef _KERNEL

module/zcommon/zfs_prop.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
*
1919
* CDDL HEADER END
2020
*/
21+
2122
/*
2223
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
24-
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25-
* Copyright 2016, Joyent, Inc.
26-
* Portions Copyright (c) 2019 by Klara Inc.
24+
* Copyright (c) 2010, Robert Milkowski. All rights reserved.
25+
* Copyright (c) 2011, 2018, Delphix. All rights reserved.
26+
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
27+
* Copyright (c) 2016, Joyent, Inc. All rights reserved.
28+
* Copyright (c) 2019, Klara Inc. All rights reserved.
29+
* Use is subject to license terms.
2730
*/
2831

29-
/* Portions Copyright 2010 Robert Milkowski */
30-
3132
#include <sys/zio.h>
3233
#include <sys/spa.h>
3334
#include <sys/u8_textprep.h>

module/zfs/arc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
*
1919
* CDDL HEADER END
2020
*/
21+
2122
/*
2223
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2018, Joyent, Inc.
24+
* Copyright (c) 2018, Joyent Inc. All rights reserved.
2425
* Copyright (c) 2011, 2019, Delphix. All rights reserved.
2526
* Copyright (c) 2014, Saso Kiselkov. All rights reserved.
26-
* Copyright (c) 2017, Nexenta Systems, Inc. All rights reserved.
27+
* Copyright (c) 2017, Nexenta Systems Inc. All rights reserved.
2728
* Copyright (c) 2019, loli10K <[email protected]>. All rights reserved.
28-
* Portions Copyright (c) 2019 by Klara Inc.
29+
* Copyright (c) 2019, Klara Inc. All rights reserved.
2930
* Copyright (c) 2020, George Amanakis. All rights reserved.
3031
*/
3132

0 commit comments

Comments
 (0)