btrfs-progs: btrfstune: add option to enable NO_HOLES

New option -n to enable the NO_HOLES feature.

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba 2015-06-02 18:41:01 +02:00
parent c476696b82
commit 6a4a3acbc2
3 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,8 @@ Enable seeding forces a fs readonly so that you can use it to build other filesy
Enable extended inode refs. Enable extended inode refs.
-x:: -x::
Enable skinny metadata extent refs. Enable skinny metadata extent refs.
-n::
Enable no-holes feature. More efficient representation of file holes.
-f:: -f::
Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure
that you are aware of the dangers. that you are aware of the dangers.

View File

@ -392,6 +392,7 @@ static void print_usage(void)
fprintf(stderr, "\t-S value\tpositive value will enable seeding, zero to disable, negative is not allowed\n"); fprintf(stderr, "\t-S value\tpositive value will enable seeding, zero to disable, negative is not allowed\n");
fprintf(stderr, "\t-r \t\tenable extended inode refs\n"); fprintf(stderr, "\t-r \t\tenable extended inode refs\n");
fprintf(stderr, "\t-x \t\tenable skinny metadata extent refs\n"); fprintf(stderr, "\t-x \t\tenable skinny metadata extent refs\n");
fprintf(stderr, "\t-n \t\tenable no-holes feature (more efficient sparse file representation)\n");
fprintf(stderr, "\t-f \t\tforce to do dangerous operation, make sure that you are aware of the dangers\n"); fprintf(stderr, "\t-f \t\tforce to do dangerous operation, make sure that you are aware of the dangers\n");
fprintf(stderr, "\t-u \t\tchange fsid, use a random one\n"); fprintf(stderr, "\t-u \t\tchange fsid, use a random one\n");
fprintf(stderr, "\t-U UUID\t\tchange fsid to UUID\n"); fprintf(stderr, "\t-U UUID\t\tchange fsid to UUID\n");
@ -412,7 +413,7 @@ int main(int argc, char *argv[])
optind = 1; optind = 1;
while(1) { while(1) {
int c = getopt(argc, argv, "S:rxfuU:"); int c = getopt(argc, argv, "S:rxfuU:n");
if (c < 0) if (c < 0)
break; break;
switch(c) { switch(c) {
@ -426,6 +427,9 @@ int main(int argc, char *argv[])
case 'x': case 'x':
super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA; super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA;
break; break;
case 'n':
super_flags |= BTRFS_FEATURE_INCOMPAT_NO_HOLES;
break;
case 'f': case 'f':
force = 1; force = 1;
break; break;

View File

@ -53,4 +53,5 @@ test_feature()
test_feature extref -r EXTENDED_IREF test_feature extref -r EXTENDED_IREF
test_feature skinny-metadata -x SKINNY_METADATA test_feature skinny-metadata -x SKINNY_METADATA
test_feature no-holes -n NO_HOLES
test_feature '' '-S 1' SEEDING test_feature '' '-S 1' SEEDING