Block compression feature in HAMMER2
This project aims to add block compression feature to HAMMER2. It consists of 2 parts: first, implementing an algorithm capable of compressing a physical block to 50% or less of its original size (in powers of 2, like 32 KB, 16 KB; the original size being 64 KB) and, second, adding a hammer2 utility command to set the compression mode on any directory, which will try to compress any written content in that directory and its subdirectories using the implemented algorithm. If the algorithm can’t compress a particular block to 50% or less of its original size, the block is written uncompressed.
HAMMER2 is a feature-filled file system which is in active development phase right now. One of its features is a block compression feature that will allow users to easily save disk space and will work on-the-fly without any intervention from user other than setting it on a directory or the whole drive.
Physical block allocations in HAMMER2 are always power-of-2, so the compressed block has to be 32KB, 16KB, 8KB, etc., since the original block size is 64KB.
Thus, the compression algorithm has to offer both good compression ratio and high compression/decompression speed, so that the user wouldn’t be able to perceive any decline in performance. At the same time, not all types of data can be efficiently compressed at all, so in case that a block can’t be compressed down to, at least, 32KB, it has to be written without compression.
At the current stage, there are 3 modes planned for this feature - #0 meaning no compression, #1 meaning zero-checking compression and #2, which will be a more complex compression algorithm. It’s possible that several complex algorithms will be implemented and users will be able to choose a specific algorithm.
Project was finished successfully.
Two different compression modes were implemented in addition to zero-checking and no-compression: LZ4 compression (fast mode) and ZLIB compression (slower mode with better compression ratio).
|File name||Size||Date submitted|
|Daniel_FloresTafur.tar.gz||206.5 KB||October 05 2013 19:18 UTC|