From c0f7e291274df28e83554fe2c38cb5e5cebddd7c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sat, 14 Oct 2017 21:54:54 +0900 Subject: [PATCH] btrfs-progs: prop: also allow "none" to disable compression Some people were asking why disabling compression via properties is not set by "none" instead. As this is purely userspace conversion to "" that kernel accepts, let's add "none" as well for convenience. Signed-off-by: David Sterba --- Documentation/btrfs-property.asciidoc | 3 ++- props.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/btrfs-property.asciidoc b/Documentation/btrfs-property.asciidoc index 97b90d6..9f31d48 100644 --- a/Documentation/btrfs-property.asciidoc +++ b/Documentation/btrfs-property.asciidoc @@ -43,7 +43,8 @@ read-only flag of subvolume: true or false label:::: label of device compression:::: -compression setting for an inode: lzo, zlib, zstd, no, or "" (empty string). Both no and "" are for disabling compression. +compression algorithm for an inode, possible values: 'lzo', 'zlib', 'zstd'. To +disable compression use "" (empty string), 'no' or 'none'. *list* [-t ] :: Lists available properties with their descriptions for the given object. diff --git a/props.c b/props.c index 94b43b4..cddbd92 100644 --- a/props.c +++ b/props.c @@ -143,7 +143,7 @@ static int prop_compression(enum prop_object_type type, xattr_name[XATTR_BTRFS_PREFIX_LEN + strlen(name)] = '\0'; if (value) { - if (strcmp(value, "no") == 0) + if (strcmp(value, "no") == 0 || strcmp(value, "none") == 0) value = ""; sret = fsetxattr(fd, xattr_name, value, strlen(value), 0); } else { -- 2.7.4