@@ -2950,7 +2950,9 @@ int main(int argc, char *argv[])
}
if (features & BTRFS_FEATURE_LIST_ALL) {
btrfs_list_all_fs_features(
- ~BTRFS_CONVERT_ALLOWED_FEATURES);
+ ~BTRFS_CONVERT_ALLOWED_FEATURES,
+ BTRFS_MKFS_DEFAULT_FEATURES |
+ BTRFS_CONVERT_FORCE_FEATURES);
exit(0);
}
@@ -1430,7 +1430,8 @@ int main(int ac, char **av)
}
free(orig);
if (features & BTRFS_FEATURE_LIST_ALL) {
- btrfs_list_all_fs_features(0);
+ btrfs_list_all_fs_features(0,
+ BTRFS_MKFS_DEFAULT_FEATURES);
exit(0);
}
break;
@@ -633,7 +633,7 @@ void btrfs_process_fs_features(u64 flags)
}
}
-void btrfs_list_all_fs_features(u64 mask_disallowed)
+void btrfs_list_all_fs_features(u64 mask_disallowed, u64 mask_default)
{
int i;
@@ -643,7 +643,7 @@ void btrfs_list_all_fs_features(u64 mask_disallowed)
if (mkfs_features[i].flag & mask_disallowed)
continue;
- if (mkfs_features[i].flag & BTRFS_MKFS_DEFAULT_FEATURES)
+ if (mkfs_features[i].flag & mask_default)
is_default = ", default";
fprintf(stderr, "%-20s- %s (0x%llx%s)\n",
mkfs_features[i].name,
@@ -112,7 +112,7 @@ void set_argv0(char **argv);
void units_set_mode(unsigned *units, unsigned mode);
void units_set_base(unsigned *units, unsigned base);
-void btrfs_list_all_fs_features(u64 mask_disallowed);
+void btrfs_list_all_fs_features(u64 mask_disallowed, u64 mask_default);
char* btrfs_parse_fs_features(char *namelist, u64 *flags);
void btrfs_process_fs_features(u64 flags);
void btrfs_parse_features_to_string(char *buf, u64 flags);
Even we tried to make mkfs and btrfs-convert use the same features, but previous patch forced btrfs-convert to use mix-bg feature. So the default fs features is different for mkfs and btrfs-convert, add mask_default parameter for btrfs_list_all_fs_features() to handle the difference. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- btrfs-convert.c | 4 +++- mkfs.c | 3 ++- utils.c | 4 ++-- utils.h | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)