From b8802ae3fa0c70d4cfc3287ed07479925973b0ac Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 9 Dec 2010 18:31:08 +0000 Subject: Btrfs-progs: add support for mixed data+metadata block groups So alot of crazy people (I'm looking at you Meego) want to use btrfs on phones and such with small devices. Unfortunately the way we split out metadata/data chunks it makes space usage inefficient for volumes that are smaller than 1gigabyte. So add a -M option for mixing metadata+data, and default to this mixed mode if the filesystem is less than or equal to 1 gigabyte. I've tested this with xfstests on a 100mb filesystem and everything is a-ok. Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 35e17b8b..ad980aed 100644 --- a/utils.c +++ b/utils.c @@ -512,7 +512,8 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, return 0; } -int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret) +int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret, + int *mixed) { u64 block_count; u64 bytenr; @@ -532,10 +533,9 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret) } zero_end = 1; - if (block_count < 256 * 1024 * 1024) { - fprintf(stderr, "device %s is too small " - "(must be at least 256 MB)\n", file); - exit(1); + if (block_count < 1024 * 1024 * 1024 && !(*mixed)) { + printf("SMALL VOLUME: forcing mixed metadata/data groups\n"); + *mixed = 1; } ret = zero_dev_start(fd); if (ret) { -- cgit v1.2.3