btrfs-progs: new --inode-flags option
The new --inode-flags option allows us to specify certain btrfs specific flags to each inode.
Currently we only support nodatacow and nodatasum.
But in the future compression flag can also be added, allowing more accurate per-file compression.
Furthermore child inodes will inherit the flag from their parents, meaning one only needs to specify the flag to the parent directory, then all children files/directories will have the flag.
This new option also works well with --subvol, although one has to note that, the inode flag inheritance does not cross subvolume boundary (the same as the kernel).
Finally, nodatacow and nodatasum will disable compression, just like the kernel.
I hope this will helps projects like mkosi and yocto to build their
images with more btrfs specific flags.
The only downside for now is the memory usage, both --subvol and
--inode-flags will take over 8K for each specification.
So one should not specify them too many times.
Something missing is the help entry:
OPTLINE("--inode-flags FLAGS:PATH", "specify that path to have inode flags, other than the default one, can be specified multiple times"),
OPTLINE("", "FLAGS is one of:"),
OPTLINE("", "- nodatacow - disable data CoW, implies nodatasum for regular files"),
OPTLINE("", "- nodatasum - disable data checksum only"),
Thanks a lot, a new fix is sent. And if David is fine with the fix, it can be folded into the original patch (which is still only in devel branch).
Merged to devel, thanks.