btrfs-progs: allow "no" to disable compression for convenience
Subsystems (2)
PATCH RESEND 1/1 btrfs-progs: allow "no" to disable compression for convenience
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose.
--- Documentation/btrfs-property.asciidoc | 2 +- props.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
Documentation/btrfs-property.asciidoc +1 -1
@@ -43,7 +43,7 @@ read-only flag of subvolume: true or false label:::: label of device compression:::: -compression setting for an inode: lzo, zlib, zstd, or "" (empty string) +compression setting for an inode: lzo, zlib, zstd, no, or "" (empty string). Both no and "" are for disabling compression. *list* [-t <type>] <object>:: Lists available properties with their descriptions for the given object.
props.c +4 -2
@@ -142,9 +142,11 @@ static int prop_compression(enum prop_object_type type,memcpy (xattr_name +XATTR_BTRFS_PREFIX_LEN , name,strlen (name)); xattr_name[XATTR_BTRFS_PREFIX_LEN +strlen (name)] ='\0' ; -if (value) +if (value) { +if (!strcmp (value,"no" )) + value ="" ; sret =fsetxattr (fd, xattr_name, value,strlen (value),0 ); -else + }else sret =fgetxattr (fd, xattr_name,NULL ,0 );if (sret <0 ) { ret = -errno;
Signature · 1 line
2.7.4
Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
Quoted 2 lines
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose.
Wouldn't 'none' be a better fit?
regards,
Koen
At Sat, 14 Oct 2017 18:19:14 +0200,
Quoted 6 lines · Koen Kooi
Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
Quoted 2 lines
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose.
Wouldn't 'none' be a better fit?
I consider "no" is better because we use nocompress or compress=no mount option to disable compression. I want to unify the expression.
Thanks,
Satoru
Quoted 9 lines
regards,
Koen
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Koen Kooi
Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
Quoted 2 lines
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose.
Wouldn't 'none' be a better fit?
'none' will be also accepted
David Sterba
AppliedQuoted 4 lines · Satoru Takeuchi
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose.
Signed-off-by Satoru Takeuchi <[email protected]>
Applied, thanks.