Sunday, January 12, 2014

Samba Transparent File Compression on Btrfs

I recently implemented support for the SMB ioctls required to allow clients to remotely manipulate file and directory compression flags on Btrfs.

Windows Explorer provides the ability to flag files and folders for transparent compression via the File->Properties->Advanced dialog box:

Windows Explorer Advanced Attributes Dialog
 
Files flagged for compression are transparently compressed and uncompressed by the underlying filesystem when accessed or modified, which normally means that storage capacity is saved at the expense of extra CPU overhead during file I/O.

New files and folders inherit the compression flag from the parent folder, unless created with the FILE_NO_COMPRESSION option.

Once flagged, Windows explorer presents compressed files and folders differently to those that aren't compressed:

Windows Explorer Directory Listing
This feature will be available with the upcoming release of Samba 4.2, and is enabled with the Btrfs Samba VFS module. E.g.:
...
[share]
        vfs objects = btrfs
        path = /mnt/btrfs_fs

No comments:

Post a Comment

Comments are moderated due to spammer abuse.