From 1733989352244572a0a53862c9377d21cbbcecf7 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 29 Nov 2017 16:42:05 +0800 Subject: 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 Signed-off-by: David Sterba --- utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 860c25d3..bd7484fd 100644 --- a/utils.h +++ b/utils.h @@ -123,6 +123,7 @@ char *__strncpy_null(char *dest, const char *src, size_t n); int is_block_device(const char *file); int is_mount_point(const char *file); int is_path_exist(const char *file); +int is_reg_file(const char *path); int check_arg_type(const char *input); int open_path_or_dev_mnt(const char *path, DIR **dirstream, int verbose); int btrfs_open(const char *path, DIR **dirstream, int verbose, int dir_only); -- cgit v1.2.3