btrfs-progs/mkfs
Qu Wenruo 1733989352 btrfs-progs: mkfs: Use the whole file or block device to mkfs for rootdir
For --rootdir, even for large existing file or block device, it will
always shrink the resulting filesystem.

The problem is, mkfs.btrfs will try to calculate the dir size, and use
it as @block_count to mkfs, which makes the filesystem shrunk.

Fix it by trying to get the original block device or file size as
@block_count, so mkfs.btrfs can use the full file/block device for
--rootdir option.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-08 18:15:20 +01:00
..
common.c btrfs-progs: mkfs: Enhance minimal device size calculation to fix mkfs failure on small file 2018-01-03 17:10:11 +01:00
common.h btrfs-progs: mkfs: Enhance minimal device size calculation to fix mkfs failure on small file 2018-01-03 17:10:11 +01:00
main.c btrfs-progs: mkfs: Use the whole file or block device to mkfs for rootdir 2018-01-08 18:15:20 +01:00
rootdir.c btrfs-progs: mkfs: Separate shrink from rootdir 2018-01-08 18:15:15 +01:00
rootdir.h btrfs-progs: mkfs: Separate shrink from rootdir 2018-01-08 18:15:15 +01:00