summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-15 15:32:16 -0400
committerDavid Sterba <dsterba@suse.cz>2013-04-23 18:56:20 +0200
commit7b20da8d525d11dabc98bdd49efef7b8be5576ab (patch)
tree8aed340d9c354b2387fffd9fe4e8b3d5f081ae35 /mkfs.c
parente5c6852c0c4ce72205dd0bab40924d2ace75cb6f (diff)
Btrfs-progs: add skinny metadata support to progs V3
This fixes up the progs to properly deal with skinny metadata. This adds the -x option to mkfs and btrfstune for enabling the skinny metadata option. This also makes changes to fsck so it can properly deal with the skinny metadata entries. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mkfs.c b/mkfs.c
index 443ece25..01180c35 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -337,6 +337,7 @@ static void print_usage(void)
fprintf(stderr, "\t -r --rootdir the source directory\n");
fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
fprintf(stderr, "\t -V --version print the mkfs.btrfs version and exit\n");
+ fprintf(stderr, "\t -x --skinny-extents use the new skinny extent disk format");
fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
@@ -397,6 +398,7 @@ static struct option long_options[] = {
{ "version", 0, NULL, 'V' },
{ "rootdir", 1, NULL, 'r' },
{ "nodiscard", 0, NULL, 'K' },
+ { "skinny-extents", 0, NULL, 'x'},
{ 0, 0, 0, 0}
};
@@ -1289,6 +1291,7 @@ int main(int ac, char **av)
int nodiscard = 0;
int ssd = 0;
int force_overwrite = 0;
+ int skinny_meta_extents = 0;
char *source_dir = NULL;
int source_dir_set = 0;
@@ -1304,8 +1307,8 @@ int main(int ac, char **av)
while(1) {
int c;
- c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:r:VMK", long_options,
- &option_index);
+ c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:r:VMKx",
+ long_options, &option_index);
if (c < 0)
break;
switch(c) {
@@ -1356,6 +1359,9 @@ int main(int ac, char **av)
case 'K':
nodiscard=1;
break;
+ case 'x':
+ skinny_meta_extents = 1;
+ break;
default:
print_usage();
}
@@ -1533,6 +1539,9 @@ raid_groups:
if (mixed)
flags |= BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS;
+ if (skinny_meta_extents)
+ flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA;
+
btrfs_set_super_incompat_flags(super, flags);
if ((data_profile | metadata_profile) &