diff options
author | David Sterba <dsterba@suse.cz> | 2013-11-14 14:30:45 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-14 12:21:17 -0500 |
commit | 492fc4482815cb59f7312e1c6645ff36a8b76fb2 (patch) | |
tree | 3aa4810b05b122f763b42ebef126d321034b38fe | |
parent | e11a9ae9bd3f9889f021494a3e61f1b7b8776a53 (diff) |
btrfs-progs: mkfs: extend -O syntax to disable features
A way of disabling features that are on by default in case it's not
wanted, eg. due to lack of support in the used kernel.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r-- | mkfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1168,7 +1168,11 @@ static int parse_one_fs_feature(const char *name, u64 *flags) int found = 0; for (i = 0; i < ARRAY_SIZE(mkfs_features); i++) { - if (!strcmp(mkfs_features[i].name, name)) { + if (name[0] == '^' && + !strcmp(mkfs_features[i].name, name + 1)) { + *flags &= ~ mkfs_features[i].flag; + found = 1; + } else if (!strcmp(mkfs_features[i].name, name)) { *flags |= mkfs_features[i].flag; found = 1; } |