btrfs-progs: mkfs: extend -O syntax to disable features
PATCH 1/1 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.
--- mkfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
mkfs.c +5 -1
@@ -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 ; }
Signature · 1 line
1.8.4.2
Quoting David Sterba (2013-11-14 08:30:45)
Quoted 15 lines
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 <[email protected]>--- mkfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)mkfs.c +0
-0@@ -1168,7 +1168,11 @@ static int parse_one_fs_feature(const char *name, u64 *flags)int found =0 ;
mkfs.c static int parse_one_fs_feature(const char *name, u64 *flags) · line 1178
Quoted 10 lines
mkfs.c +5
-1for (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 ; }
Perfect, I was going to do this today so I can enable extrefs.
-chris
Quoted 16 lines · Chris Mason
Quoting David Sterba (2013-11-14 08:30:45)
Quoted 15 lines
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 <[email protected]>--- mkfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)mkfs.c +0
-0@@ -1168,7 +1168,11 @@ static int parse_one_fs_feature(const char *name, u64 *flags)int found =0 ;
Quoted 12 lines
mkfs.c static int parse_one_fs_feature(const char *name, u64 *flags) · line 1178
Quoted 10 lines
mkfs.c +5
-1for (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 ; }Perfect, I was going to do this today so I can enable extrefs.
Just sent :)
Quoting David Sterba (2013-11-14 09:14:14)
Quoted 31 lines · Chris Mason
Quoted 16 lines
Quoting David Sterba (2013-11-14 08:30:45)
Quoted 15 lines
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 <[email protected]>--- mkfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)mkfs.c +0
-0@@ -1168,7 +1168,11 @@ static int parse_one_fs_feature(const char *name, u64 *flags)int found =0 ;Quoted 12 lines
mkfs.c static int parse_one_fs_feature(const char *name, u64 *flags) · line 1178
Quoted 10 lines
mkfs.c +5
-1for (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 ; }Perfect, I was going to do this today so I can enable extrefs.
Just sent :)