btrfs-progs
btrfs-progs copied to clipboard
mkfs: discard or reset zones in parallel
Devices are processed one by one and the preparatory phase is sum of all times when discarding or resetting zones. This can be done in parallel so the overall time is the maximum not the sum.
btrfs_prepare_device takes flags which operations to do, so the loop in mkfs/main can be split to first only reset the devices and then add them to the filesystem. The first device is handled separately but should be also part of the parallel reset (ideally).