1. 20 Aug, 2020 1 commit
    • Michael Niewöhner's avatar
      Add zstd support to zfs · 10b3c7f5
      Michael Niewöhner authored
      
      This PR adds two new compression types, based on ZStandard:
      
      - zstd: A basic ZStandard compression algorithm Available compression.
        Levels for zstd are zstd-1 through zstd-19, where the compression
        increases with every level, but speed decreases.
      
      - zstd-fast: A faster version of the ZStandard compression algorithm
        zstd-fast is basically a "negative" level of zstd. The compression
        decreases with every level, but speed increases.
      
        Available compression levels for zstd-fast:
         - zstd-fast-1 through zstd-fast-10
         - zstd-fast-20 through zstd-fast-100 (in increments of 10)
         - zstd-fast-500 and zstd-fast-1000
      
      For more information check the man page.
      
      Implementation details:
      
      Rather than treat each level of zstd as a different algorithm (as was
      done historically with gzip), the block pointer `enum zio_compress`
      value is simply zstd for all levels, including zstd-fast, since they all
      use the same decompression function.
      
      The compress= property (a 64bit unsigned integer) uses the lower 7 bits
      to store the compression algorithm (matching the number of bits used in
      a block pointer, as the 8th bit was borrowed for embedded block
      pointers).  The upper bits are used to store the compression level.
      
      It is necessary to be able to determine what compression level was used
      when later reading a block back, so the concept used in LZ4, where the
      first 32bits of the on-disk value are the size of the compressed data
      (since the allocation is rounded up to the nearest ashift), was
      extended, and we store the version of ZSTD and the level as well as the
      compressed size. This value is returned when decompressing a block, so
      that if the block needs to be recompressed (L2ARC, nop-write, etc), that
      the same parameters will be used to result in the matching checksum.
      
      All of the internal ZFS code ( `arc_buf_hdr_t`, `objset_t`,
      `zio_prop_t`, etc.) uses the separated _compress and _complevel
      variables.  Only the properties ZAP contains the combined/bit-shifted
      value. The combined value is split when the compression_changed_cb()
      callback is called, and sets both objset members (os_compress and
      os_complevel).
      
      The userspace tools all use the combined/bit-shifted value.
      
      Additional notes:
      
      zdb can now also decode the ZSTD compression header (flag -Z) and
      inspect the size, version and compression level saved in that header.
      For each record, if it is ZSTD compressed, the parameters of the decoded
      compression header get printed.
      
      ZSTD is included with all current tests and new tests are added
      as-needed.
      
      Per-dataset feature flags now get activated when the property is set.
      If a compression algorithm requires a feature flag, zfs activates the
      feature when the property is set, rather than waiting for the first
      block to be born.  This is currently only used by zstd but can be
      extended as needed.
      
      Portions-Sponsored-By: The FreeBSD Foundation
      Co-authored-by: default avatarAllan Jude <allanjude@freebsd.org>
      Co-authored-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Co-authored-by: default avatarSebastian Gottschall <s.gottschall@dd-wrt.com>
      Co-authored-by: default avatarKjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
      Co-authored-by: default avatarMichael Niewöhner <foss@mniewoehner.de>
      Signed-off-by: default avatarAllan Jude <allan@klarasystems.com>
      Signed-off-by: default avatarAllan Jude <allanjude@freebsd.org>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarSebastian Gottschall <s.gottschall@dd-wrt.com>
      Signed-off-by: default avatarKjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
      Signed-off-by: default avatarMichael Niewöhner <foss@mniewoehner.de>
      Closes #6247
      Closes #9024
      Closes #10277
      Closes #10278
      10b3c7f5
  2. 11 Aug, 2020 1 commit
  3. 29 May, 2018 1 commit
    • Brian Behlendorf's avatar
      Update build system and packaging · 93ce2b4c
      Brian Behlendorf authored
      
      Minimal changes required to integrate the SPL sources in to the
      ZFS repository build infrastructure and packaging.
      
      Build system and packaging:
        * Renamed SPL_* autoconf m4 macros to ZFS_*.
        * Removed redundant SPL_* autoconf m4 macros.
        * Updated the RPM spec files to remove SPL package dependency.
        * The zfs package obsoletes the spl package, and the zfs-kmod
          package obsoletes the spl-kmod package.
        * The zfs-kmod-devel* packages were updated to add compatibility
          symlinks under /usr/src/spl-x.y.z until all dependent packages
          can be updated.  They will be removed in a future release.
        * Updated copy-builtin script for in-kernel builds.
        * Updated DKMS package to include the spl.ko.
        * Updated stale AUTHORS file to include all contributors.
        * Updated stale COPYRIGHT and included the SPL as an exception.
        * Renamed README.markdown to README.md
        * Renamed OPENSOLARIS.LICENSE to LICENSE.
        * Renamed DISCLAIMER to NOTICE.
      
      Required code changes:
        * Removed redundant HAVE_SPL macro.
        * Removed _BOOT from nvpairs since it doesn't apply for Linux.
        * Initial header cleanup (removal of empty headers, refactoring).
        * Remove SPL repository clone/build from zimport.sh.
        * Use of DEFINE_RATELIMIT_STATE and DEFINE_SPINLOCK removed due
          to build issues when forcing C99 compilation.
        * Replaced legacy ACCESS_ONCE with READ_ONCE.
        * Include needed headers for `current` and `EXPORT_SYMBOL`.
      Reviewed-by: default avatarTony Hutter <hutter2@llnl.gov>
      Reviewed-by: default avatarOlaf Faaland <faaland1@llnl.gov>
      Reviewed-by: default avatarMatthew Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarPavel Zakharov <pavel.zakharov@delphix.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      TEST_ZIMPORT_SKIP="yes"
      Closes #7556
      93ce2b4c
  4. 02 Sep, 2014 1 commit
  5. 21 Mar, 2013 1 commit
    • Darik Horn's avatar
      Fix minor typos and update marketing copy. · 09fb1ec4
      Darik Horn authored
      
      Correct spelling mistakes in the AUTHORS and DISCLAIMER files, and
      update the README.markdown file to credit Illumos and mention that
      the ZPL is finished.
      
      The README.markdown file is also the first impression for a handful
      of new users that discover ZoL through a web search because it
      doubles as the splash page for the Github repository. The build blurbs
      are therefore removed because these people should be encouraged to
      visit the regular home page before installing the product.
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #1366
      09fb1ec4
  6. 19 Dec, 2012 2 commits
  7. 17 Jun, 2011 1 commit
    • Christian Kohlschütter's avatar
      Add "ashift" property to zpool create · df30f566
      Christian Kohlschütter authored
      
      Some disks with internal sectors larger than 512 bytes (e.g., 4k) can
      suffer from bad write performance when ashift is not configured
      correctly.  This is caused by the disk not reporting its actual sector
      size, but a sector size of 512 bytes.  The drive may behave this way
      for compatibility reasons.  For example, the WDC WD20EARS disks are
      known to exhibit this behavior.
      
      When creating a zpool, ZFS takes that wrong sector size and sets the
      "ashift" property accordingly (to 9: 1<<9=512), whereas it should be
      set to 12 for 4k sectors (1<<12=4096).
      
      This patch allows an adminstrator to manual specify the known correct
      ashift size at 'zpool create' time.  This can significantly improve
      performance in certain cases.  However, it will have an impact on your
      total pool capacity.  See the updated ashift property description
      in the zpool.8 man page for additional details.
      
      Valid values for the ashift property range from 9 to 17 (512B-128KB).
      Additionally, you may set the ashift to 0 if you wish to auto-detect
      the sector size based on what the disk reports, this is the default
      behavior.  The most common ashift values are 9 and 12.
      
        Example:
        zpool create -o ashift=12 tank raidz2 sda sdb sdc sdd
      
      Closes #280
      Original-patch-by: default avatarRichard Laager <rlaager@wiktel.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      df30f566
  8. 19 Apr, 2011 1 commit
  9. 17 Mar, 2011 1 commit
    • Manuel Amador (Rudd-O)'s avatar
      Add dracut support · ae26d046
      Manuel Amador (Rudd-O) authored
      
      To simplify the process of using zfs as your root filesystem a
      zfs-drucat sub-package has been added.  This sub-package adds a zfs
      dracut module which allows your initramfs to be rebuilt with zfs
      support.  The process for doing this is still complicated but there
      is clearly interest from the community about getting this working
      well and documented.  This should help lay some of the groundwork.
      
      Longer term these changes should be pushed in the upstream dracut
      package.  Once that occurs this subpackage will no longer be
      required for new systems, however we may want to conditionally
      build this package in the future for systems running older
      dracut versions.
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      ae26d046
  10. 10 Feb, 2011 1 commit
    • Brian Behlendorf's avatar
      Update AUTHORS file · 6c9e06f1
      Brian Behlendorf authored
      This file has gotten stale and needed to be updated.  There are
      individuals who deserve to be recognized for their contributions
      to the project.  I've done my best to assemble names from the
      commit logs of those who have submitted patches.  This list may
      not be comprehensive, if you feel I've overlooked your contribution
      please let me know and we can get your name added.
      6c9e06f1
  11. 18 May, 2010 1 commit
  12. 17 May, 2010 1 commit
    • Brian Behlendorf's avatar
      Public Release Prep · 716154c5
      Brian Behlendorf authored
      Updated AUTHORS, COPYING, DISCLAIMER, and INSTALL files.  Added
      standardized headers to all source file to clearly indicate the
      copyright, license, and to give credit where credit is due.
      716154c5
  13. 20 Mar, 2009 1 commit
  14. 02 Dec, 2008 1 commit
  15. 20 Nov, 2008 1 commit
  16. 26 May, 2008 1 commit