summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/btrfstune.asciidoc2
-rw-r--r--btrfstune.c6
-rwxr-xr-xtests/misc-tests/001-btrfstune-features/test.sh1
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