Use getopts to allow free ordering of "-f" and device name
Explicitly enable extref and skinny-metadata features when creating the filesystem
The first one is quite self-descriptive, this is just an improvement of interactive issue to avoid mystery failures when the arguments are called with different order.
The two btrfs features enabled here are default in recent Linux kernel/btrfs-progs, but vary in older ones, we are enabling them explicitly to make sure those features are present. Because our containers are mostly small files while having a great chance of having files COW'ed, we want these features to make metadata handling more robust.
From btrfs documentation:
extref (default since btrfs-progs 3.12, kernel support since 3.7) increased hardlink limit per file in a directory to 65536, older kernels supported a varying number of hardlinks depending on the sum of all file name sizes that can be stored into one metadata block
skinny-metadata (default since btrfs-progs 3.18, kernel support since 3.10) reduced-size metadata for extent references, saves a few percent of metadata
This PR includes two changes:
The first one is quite self-descriptive, this is just an improvement of interactive issue to avoid mystery failures when the arguments are called with different order.
The two btrfs features enabled here are default in recent Linux kernel/btrfs-progs, but vary in older ones, we are enabling them explicitly to make sure those features are present. Because our containers are mostly small files while having a great chance of having files COW'ed, we want these features to make metadata handling more robust.
From btrfs documentation: