btrfs-progs: mkfs: refactor test_minimum_size to use the calculated minimal size
authorQu Wenruo <wqu@suse.com>
Mon, 16 Oct 2017 08:22:56 +0000 (16:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Nov 2017 14:59:00 +0000 (15:59 +0100)
commitb84aa6033c340118e5ecc18acecd6b7492569fa7
treeeb134049a739d0b49e7ce51610550a8398334ad7
parentda2659b090af383dea6dec71d2d4e128c643d455
btrfs-progs: mkfs: refactor test_minimum_size to use the calculated minimal size

test_minimum_size() function is only called to check if provided device
is large enough.

However the minimal device size only needs to be calculated once, and
can be reused everywhere.

Refactor that function to make later modification easier.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
mkfs/common.c
mkfs/common.h
mkfs/main.c