diff options
author | David Sterba <dsterba@suse.cz> | 2015-06-02 18:41:01 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-06-03 12:52:56 +0200 |
commit | 6a4a3acbc21d08065d64d57b08bb0d7f78e388ca (patch) | |
tree | 384eef8977294ae39fafe5c70159977c55b40f32 | |
parent | c476696b824ed593d0ed4494b32fa492875ca2db (diff) |
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>
-rw-r--r-- | Documentation/btrfstune.asciidoc | 2 | ||||
-rw-r--r-- | btrfstune.c | 6 | ||||
-rwxr-xr-x | tests/misc-tests/001-btrfstune-features/test.sh | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/btrfstune.asciidoc b/Documentation/btrfstune.asciidoc index b6edcb20..59f1500d 100644 --- a/Documentation/btrfstune.asciidoc +++ b/Documentation/btrfstune.asciidoc @@ -24,6 +24,8 @@ Enable seeding forces a fs readonly so that you can use it to build other filesy Enable extended inode refs. -x:: Enable skinny metadata extent refs. +-n:: +Enable no-holes feature. More efficient representation of file holes. -f:: Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure that you are aware of the dangers. diff --git a/btrfstune.c b/btrfstune.c index 31836313..dd5626ef 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -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-r \t\tenable extended inode 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-u \t\tchange fsid, use a random one\n"); fprintf(stderr, "\t-U UUID\t\tchange fsid to UUID\n"); @@ -412,7 +413,7 @@ int main(int argc, char *argv[]) optind = 1; while(1) { - int c = getopt(argc, argv, "S:rxfuU:"); + int c = getopt(argc, argv, "S:rxfuU:n"); if (c < 0) break; switch(c) { @@ -426,6 +427,9 @@ int main(int argc, char *argv[]) case 'x': super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA; break; + case 'n': + super_flags |= BTRFS_FEATURE_INCOMPAT_NO_HOLES; + break; case 'f': force = 1; break; diff --git a/tests/misc-tests/001-btrfstune-features/test.sh b/tests/misc-tests/001-btrfstune-features/test.sh index 4ce3411f..c9981e6e 100755 --- a/tests/misc-tests/001-btrfstune-features/test.sh +++ b/tests/misc-tests/001-btrfstune-features/test.sh @@ -53,4 +53,5 @@ test_feature() test_feature extref -r EXTENDED_IREF test_feature skinny-metadata -x SKINNY_METADATA +test_feature no-holes -n NO_HOLES test_feature '' '-S 1' SEEDING |