Skip to content

Commit

Permalink
Formal changes: tests, documentation, copyright
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
4 people committed May 2, 2020
1 parent db154a3 commit 8f71e1e
Show file tree
Hide file tree
Showing 23 changed files with 256 additions and 117 deletions.
24 changes: 24 additions & 0 deletions contrib/zstd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ZSTD Contrib Library Manual

## Introduction

This `contrib` contains the ZSTD library used in ZFS. It is heavily cut-down by
dropping any unneeded files but otherwise is intentionally unmodified. Please do
not alter these files in any way, besides upgrading to a newer ZSTD release.

## Updating ZSTD

To update ZSTD the following steps need to be taken:

1. Grab the latest release of [ZSTD](https://github.com/facebook/zstd/releases).
2. Replace (not merge) `common`, `compress`, `decompress` and `zstd.h` with the
new versions from `lib/`.
3. Make sure any newly required files and/or folders are also included.
1. Add an empty file `Makefile.am` inside any new folder.
2. Add them to `AC_CONFIG_FILES` in `configure.ac` accordingly.
3. Make sure new files/folders are listed in
- `contrib/zstd/Makefile.am`
- `lib/libzstd/Makefile.am`
- `module/zstd/Makefile.in`
- this README
4. Update the version `ZFS_MODULE_VERSION("x.y.z")` in `module/zstd/zstd.c`.
8 changes: 6 additions & 2 deletions include/sys/arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2016 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2012, 2016, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Use is subject to license terms.
*/

#ifndef _SYS_ARC_H
Expand Down
20 changes: 12 additions & 8 deletions include/sys/spa.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2019 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright 2013 Saso Kiselkov. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Joyent, Inc.
* Copyright (c) 2017, 2019, Datto Inc. All rights reserved.
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2011, 2019, Delphix. All rights reserved.
* Copyright (c) 2011, Nexenta Systems Inc. All rights reserved.
* Copyright (c) 2014, Spectra Logic Corporation. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2014, Integros. All rights reserved.
* Copyright (c) 2017, Joyent, Inc. All rights reserved.
* Copyright (c) 2017, Datto Inc. All rights reserved.
* Copyright (c) 2017, Intel Corporation. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Use is subject to license terms.
*/

#ifndef _SYS_SPA_H
Expand Down
11 changes: 7 additions & 4 deletions include/sys/zio.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2011, Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, 2018, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 Toomas Soome <[email protected]>
* Copyright (c) 2016, Toomas Soome. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Use is subject to license terms.
*/

#ifndef _ZIO_H
Expand Down
6 changes: 4 additions & 2 deletions include/sys/zio_compress.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
*/

/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009, Sun Microsystems Inc. All rights reserved.
* Copyright (c) 2015, 2016, Delphix. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Use is subject to license terms.
* Copyright (c) 2015, 2016 by Delphix. All rights reserved.
*/

#ifndef _SYS_ZIO_COMPRESS_H
Expand Down
44 changes: 41 additions & 3 deletions man/man5/zpool-features.5
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
'\" te
.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development
.\" and Distribution License (the "License"). You may not use this file except
.\" in compliance with the License. You can obtain a copy of the license at
Expand All @@ -14,6 +11,11 @@
.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
.\" own identifying information:
.\" Portions Copyright [yyyy] [name of copyright owner]
.\" Copyright (c) 2012, 2018, Delphix. All rights reserved.
.\" Copyright (c) 2013, Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, Joyent Inc. All rights reserved.
.\" Copyright (c) 2019, Klara Inc. All rights reserved.
.\" Copyright (c) 2019, Allan Jude. All rights reserved.
.TH ZPOOL-FEATURES 5 "Jun 8, 2018"
.SH NAME
zpool\-features \- ZFS pool feature descriptions
Expand Down Expand Up @@ -926,6 +928,42 @@ This feature becomes \fBactive\fR when the \fBzpool checkpoint\fR subcommand
is used to checkpoint the pool.
The feature will only return back to being \fBenabled\fR when the pool
is rewound or the checkpoint has been discarded.
.RE

.sp
.ne 2
.na
\fBzstd_compress\fR
.ad
.RS 4n
.TS
l l .
GUID org.freebsd:zstd_compress
READ\-ONLY COMPATIBLE no
DEPENDENCIES none
.TE

\fBzstd\fR is a high-performance compression algorithm that features a
combination of high compression ratios and high speed. Compared to \fBgzip\fR,
\fBzstd\fR offers slighty better compression at much higher speeds. Compared
to \fBlz4\fR, \fBzstd\fR offers much better compression while being only
modestly slower. Typically, \fBzstd\fR compression speed ranges from 250 to 500
MB/s per thread and decompression speed is over 1 GB/s per thread.

When the \fBzstd\fR feature is set to \fBenabled\fR, the administrator can turn
on \fBzstd\fR compression of any dataset by running
`zfs set compress=zstd <pool/fs>`.

This feature becomes \fBactive\fR once a \fBcompress\fR property has been set to
\fBzstd\fR, and will return to being \fBenabled\fR once all filesystems that
have ever had their compress property set to \fBzstd\fR are destroyed.

Booting off of \fBzstd\fR-compressed root pools is not yet supported.

Sending a \fBzstd\fR dataset to a non-\fBzstd zpool\fR by \fBzfs send -e\fR is
not possible and will result in an error. Either drop the \fB-e\fR option or
enable \fBzstd\fR on the receiver \fBzpool\fR.
.RE

.SH "SEE ALSO"
zpool(8)
65 changes: 47 additions & 18 deletions man/man8/zfsprops.8
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,22 @@
.\" CDDL HEADER END
.\"
.\"
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2011 Joshua M. Clulow <[email protected]>
.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
.\" Copyright (c) 2011, Pawel Jakub Dawidek <[email protected]>
.\" Copyright (c) 2012, Glen Barber <[email protected]>
.\" Copyright (c) 2012, Bryan Drewery <[email protected]>
.\" Copyright (c) 2013, Steven Hartland <[email protected]>
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
.\" Copyright (c) 2014 Integros [integros.com]
.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright (c) 2014, Xin LI <[email protected]>
.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
.\" Copyright 2019 Richard Laager. All rights reserved.
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright (c) 2011, Joshua M. Clulow. All Rights Reserved.
.\" Copyright (c) 2011, 2019, Delphix. All rights reserved.
.\" Copyright (c) 2011, Pawel Jakub Dawidek. All rights reserved.
.\" Copyright (c) 2012, Glen Barber. All rights reserved.
.\" Copyright (c) 2012, Bryan Drewery. All rights reserved.
.\" Copyright (c) 2013, Steven Hartland. All rights reserved.
.\" Copyright (c) 2013, Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, 2019, Joyent, Inc. All rights reserved.
.\" Copyright (c) 2014, Adam Stevko. All rights reserved.
.\" Copyright (c) 2014, Integros. All rights reserved.
.\" Copyright (c) 2014, Xin LI. All rights reserved.
.\" Copyright (c) 2014-2015, The FreeBSD Foundation. All Rights Reserved.
.\" Copyright (c) 2016, 2018, Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2019, Richard Laager. All rights reserved.
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing. All rights reserved.
.\"
.Dd January 30, 2020
.Dt ZFSPROPS 8
Expand Down Expand Up @@ -774,7 +773,8 @@ for more information on these algorithms.
Changing this property affects only newly-written data.
.It Xo
.Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns
.Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle
.Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle Ns | Ns Sy zstd Ns | Ns
.Sy zstd- Ns Em N Ns | Ns Sy zstd-fast- Ns Em N
.Xc
Controls the compression algorithm used for this dataset.
.Pp
Expand Down Expand Up @@ -842,6 +842,35 @@ is equivalent to
.Pc .
.Pp
The
.Sy zstd
compression using the zstd algorithm ,
You can specify the
.Sy zstd
level by using the value
.Sy zstd- Ns Em N ,
where
.Em N
is an integer from 1
.Pq fastest
to 19
.Pq best compression ratio .
.Sy zstd
You can also specify a negative
.Sy zstd
level by using the value
.Sy zstd- Ns Em N ,
where
.Em N
is an integer from 100
.Pq fastest
to 1
.Pq best compression ratio .
.Sy zstd
is equivalent to
.Sy zstd-3
.Pc .
.Pp
The
.Sy zle
compression algorithm compresses runs of zeros.
.Pp
Expand Down
13 changes: 8 additions & 5 deletions module/zcommon/zfeature_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
*/

/*
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2011, 2018, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent Inc. All rights reserved.
* Copyright (c) 2014, Nexenta Systems Inc. All rights reserved.
* Copyright (c) 2017, Intel Corporation. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Use is subject to license terms.
*/

#ifndef _KERNEL
Expand Down
13 changes: 7 additions & 6 deletions module/zcommon/zfs_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright 2016, Joyent, Inc.
* Portions Copyright (c) 2019 by Klara Inc.
* Copyright (c) 2010, Robert Milkowski. All rights reserved.
* Copyright (c) 2011, 2018, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2016, Joyent, Inc. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Use is subject to license terms.
*/

/* Portions Copyright 2010 Robert Milkowski */

#include <sys/zio.h>
#include <sys/spa.h>
#include <sys/u8_textprep.h>
Expand Down
7 changes: 4 additions & 3 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, Joyent, Inc.
* Copyright (c) 2018, Joyent Inc. All rights reserved.
* Copyright (c) 2011, 2019, Delphix. All rights reserved.
* Copyright (c) 2014, Saso Kiselkov. All rights reserved.
* Copyright (c) 2017, Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2017, Nexenta Systems Inc. All rights reserved.
* Copyright (c) 2019, loli10K <[email protected]>. All rights reserved.
* Portions Copyright (c) 2019 by Klara Inc.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Copyright (c) 2020, George Amanakis. All rights reserved.
*/

Expand Down
12 changes: 8 additions & 4 deletions module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, 2019 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright (c) 2011, Nexenta Systems Inc. All rights reserved.
* Copyright (c) 2012, 2019, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2014, Spectra Logic Corporation. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Use is subject to license terms.
*/

#include <sys/zfs_context.h>
Expand Down
12 changes: 8 additions & 4 deletions module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
*
* CDDL HEADER END
*/

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2011, 2020, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2016, Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2015 by Chunwei Chen. All rights reserved.
* Copyright (c) 2019 Datto Inc.
* Copyright (c) 2015, Chunwei Chen. All rights reserved.
* Copyright (c) 2019, Datto Inc. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Use is subject to license terms.
*/

#include <sys/dmu.h>
Expand Down
22 changes: 12 additions & 10 deletions module/zfs/dmu_objset.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright (c) 2015, STRATO AG, Inc. All rights reserved.
* Copyright (c) 2016 Actifio, Inc. All rights reserved.
* Copyright 2017 Nexenta Systems, Inc.
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
* Copyright (c) 2010, Robert Milkowski. All rights reserved.
* Copyright (c) 2012, 2018, Delphix. All rights reserved.
* Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent Inc. All rights reserved.
* Copyright (c) 2014, Spectra Logic Corporation. All rights reserved.
* Copyright (c) 2015, STRATO AG. All rights reserved.
* Copyright (c) 2016, Actifio Inc. All rights reserved.
* Copyright (c) 2017, Nexenta Systems Inc. All Rights Reserved.
* Copyright (c) 2017, Open-E Inc. All Rights Reserved.
* Copyright (c) 2018, loli10K <[email protected]>. All rights reserved.
* Copyright (c) 2019, Klara Inc. All rights reserved.
* Copyright (c) 2019, Allan Jude. All rights reserved.
* Use is subject to license terms.
*/

/* Portions Copyright 2010 Robert Milkowski */

#include <sys/zfeature.h>
#include <sys/cred.h>
#include <sys/zfs_context.h>
Expand Down
Loading

0 comments on commit 8f71e1e

Please sign in to comment.