zstd/contrib/linux-kernel
2017-04-04 18:39:22 -07:00
..
fs/btrfs Fix up some old names 2017-04-04 17:03:48 -07:00
include/linux Move zstd.h to linux/zstd.h 2017-04-04 15:44:27 -07:00
lib Add Kconfig and Makefile diffs 2017-04-04 18:37:55 -07:00
test Move sources to lib/zstd/ 2017-04-04 16:30:11 -07:00
.gitignore fix gitignore 2017-04-04 18:15:21 -07:00
README.md Add a README 2017-04-04 18:39:22 -07:00
spaces_to_tabs.sh spaces to tabs 2017-03-30 14:47:42 -07:00

Linux Kernel Patch

There are two pieces, the zstd_compress and zstd_decompress kernel modules, and the BtrFS patch. The patches are based off of the linux kernel version 4.9. The BtrFS patch is not present in its entirety yet.

Zstd Kernel modules

  • The header is in include/linux/zstd.h.
  • It is split up into zstd_compress and zstd_decompress, which can be loaded independently.
  • Source files are in lib/zstd/.
  • lib/Kconfig and lib/Makefile need to be modified by applying lib/Kconfig.diff and lib/Makefile.diff respectively.
  • test/UserlandTest.cpp contains tests for the patch in userland by mocking the kernel headers. It can be run with the following commands:
    cd test
    make googletest
    make UserlandTest
    ./UserlandTest
    

BtrFS

  • fs/btrfs/zstd.c is provided.
  • Some more glue is required to integrate it with BtrFS, but I haven't included the patches yet. In the meantime see 1914f7d4ca if you're interested.