zstd/contrib/linux-kernel
2017-04-04 19:02:28 -07:00
..
2017-04-04 17:03:48 -07:00
2017-04-04 18:37:55 -07:00
2017-04-04 16:30:11 -07:00
2017-04-04 18:15:21 -07:00
2017-04-04 18:39:22 -07:00
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.