diff options
author | Josef Bacik <josef@redhat.com> | 2010-12-09 18:31:08 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-10-25 09:18:31 -0400 |
commit | b8802ae3fa0c70d4cfc3287ed07479925973b0ac (patch) | |
tree | ba2a311453c9a8783121bade7d8a6e64fad791fc /utils.c | |
parent | e2a6859d93254ee0cdb2bf575aa23b624bc735e5 (diff) |
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 <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) { |