btrfs-progs: mkfs: accept mixed case for profile names

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba 2015-06-06 01:03:48 +02:00
parent d34f9faf60
commit 42a8983143

12
mkfs.c
View File

@ -303,17 +303,17 @@ static u64 parse_profile(char *s)
{
if (strcmp(s, "raid0") == 0) {
return BTRFS_BLOCK_GROUP_RAID0;
} else if (strcmp(s, "raid1") == 0) {
} else if (strcasecmp(s, "raid1") == 0) {
return BTRFS_BLOCK_GROUP_RAID1;
} else if (strcmp(s, "raid5") == 0) {
} else if (strcasecmp(s, "raid5") == 0) {
return BTRFS_BLOCK_GROUP_RAID5;
} else if (strcmp(s, "raid6") == 0) {
} else if (strcasecmp(s, "raid6") == 0) {
return BTRFS_BLOCK_GROUP_RAID6;
} else if (strcmp(s, "raid10") == 0) {
} else if (strcasecmp(s, "raid10") == 0) {
return BTRFS_BLOCK_GROUP_RAID10;
} else if (strcmp(s, "dup") == 0) {
} else if (strcasecmp(s, "dup") == 0) {
return BTRFS_BLOCK_GROUP_DUP;
} else if (strcmp(s, "single") == 0) {
} else if (strcasecmp(s, "single") == 0) {
return 0;
} else {
fprintf(stderr, "Unknown profile %s\n", s);