Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
625 stars 56 forks source link

How exactly is the compression method set and how might one go about changing it? #256

Open dcflachs opened 1 year ago

dcflachs commented 1 year ago

https://github.com/Zygo/bees/blob/717bdf5eb5e22d3ade0e6a5cf489a46d2a52e9f5/docs/missing.md?plain=1#L39-L41 My sleuthing around the codebase found this. https://github.com/Zygo/bees/blob/717bdf5eb5e22d3ade0e6a5cf489a46d2a52e9f5/src/bees.cc?plain=1#L398-L404 Is compression enabled by applying the compress attribute to this tmp file? If so would not explicitly applying the attribute let the file have the compression specified by BTRFS mount in which it resides (assuming forced compression is set on the mount)?

Zygo commented 1 year ago

This sets the fsattribute but does not specify compression method. btrfs takes the method from the compress mount option (force-compress is not necessary). If compress isn't set in the mount options, zlib is the unfortunate default method.