diff options
author | Chris Mason <chris.mason@fusionio.com> | 2012-07-05 11:35:42 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-07-05 11:35:42 -0400 |
commit | 2588b4f8bedda4fc11379b079ac42fd47f34024f (patch) | |
tree | d4ac395f014c066cb6772682e57ff592f836bfea /mkfs.c | |
parent | 06cf101a28d82183f562741184bfb61ba9347a57 (diff) | |
parent | 35d7b486b3e7655b812f67a7eec662dd31ffa302 (diff) |
Merge branch 'for-chris' of git://github.com/idryomov/btrfs-progs into 0.20
Diffstat (limited to 'mkfs.c')
-rw-r--r-- | mkfs.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -263,17 +263,23 @@ static int create_raid_groups(struct btrfs_trans_handle *trans, if (metadata_profile & ~allowed) { fprintf(stderr, "unable to create FS with metadata " - "profile %llu (%llu devices)\n", metadata_profile, + "profile %llu (have %llu devices)\n", metadata_profile, num_devices); exit(1); } if (data_profile & ~allowed) { fprintf(stderr, "unable to create FS with data " - "profile %llu (%llu devices)\n", data_profile, + "profile %llu (have %llu devices)\n", data_profile, num_devices); exit(1); } + /* allow dup'ed data chunks only in mixed mode */ + if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) { + fprintf(stderr, "dup for data is allowed only in mixed mode\n"); + exit(1); + } + if (allowed & metadata_profile) { u64 meta_flags = BTRFS_BLOCK_GROUP_METADATA; @@ -334,7 +340,7 @@ static void print_usage(void) fprintf(stderr, "options:\n"); fprintf(stderr, "\t -A --alloc-start the offset to start the FS\n"); fprintf(stderr, "\t -b --byte-count total number of bytes in the FS\n"); - fprintf(stderr, "\t -d --data data profile, raid0, raid1, raid10 or single\n"); + fprintf(stderr, "\t -d --data data profile, raid0, raid1, raid10, dup or single\n"); fprintf(stderr, "\t -l --leafsize size of btree leaves\n"); fprintf(stderr, "\t -L --label set a label\n"); fprintf(stderr, "\t -m --metadata metadata profile, values like data profile\n"); @@ -360,10 +366,12 @@ static u64 parse_profile(char *s) return BTRFS_BLOCK_GROUP_RAID1; } else if (strcmp(s, "raid10") == 0) { return BTRFS_BLOCK_GROUP_RAID10; + } else if (strcmp(s, "dup") == 0) { + return BTRFS_BLOCK_GROUP_DUP; } else if (strcmp(s, "single") == 0) { return 0; } else { - fprintf(stderr, "Unknown option %s\n", s); + fprintf(stderr, "Unknown profile %s\n", s); print_usage(); } /* not reached */ |