* [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience
@ 2017-10-14 12:54 Satoru Takeuchi
2017-10-14 16:19 ` Koen Kooi
2017-10-17 18:16 ` David Sterba
0 siblings, 2 replies; 5+ messages in thread
From: Satoru Takeuchi @ 2017-10-14 12:54 UTC (permalink / raw)
To: linux-btrfs
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 <satoru.takeuchi@gmail.com>
---
Documentation/btrfs-property.asciidoc | 2 +-
props.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/btrfs-property.asciidoc b/Documentation/btrfs-property.asciidoc
index 7ed6a7d..97b90d6 100644
--- a/Documentation/btrfs-property.asciidoc
+++ b/Documentation/btrfs-property.asciidoc
@@ -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.
diff --git a/props.c b/props.c
index a7e3e96..a2df868 100644
--- a/props.c
+++ b/props.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience
2017-10-14 12:54 [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience Satoru Takeuchi
@ 2017-10-14 16:19 ` Koen Kooi
2017-10-14 23:02 ` Satoru Takeuchi
2017-10-17 18:16 ` David Sterba
2017-10-17 18:16 ` David Sterba
1 sibling, 2 replies; 5+ messages in thread
From: Koen Kooi @ 2017-10-14 16:19 UTC (permalink / raw)
To: linux-btrfs
Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience
2017-10-14 16:19 ` Koen Kooi
@ 2017-10-14 23:02 ` Satoru Takeuchi
2017-10-17 18:16 ` David Sterba
1 sibling, 0 replies; 5+ messages in thread
From: Satoru Takeuchi @ 2017-10-14 23:02 UTC (permalink / raw)
To: Koen Kooi; +Cc: linux-btrfs
At Sat, 14 Oct 2017 18:19:14 +0200,
Koen Kooi wrote:
>
> Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
> > 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
>
> regards,
>
> Koen
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience
2017-10-14 16:19 ` Koen Kooi
2017-10-14 23:02 ` Satoru Takeuchi
@ 2017-10-17 18:16 ` David Sterba
1 sibling, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-10-17 18:16 UTC (permalink / raw)
To: Koen Kooi; +Cc: linux-btrfs
On Sat, Oct 14, 2017 at 06:19:14PM +0200, Koen Kooi wrote:
> Op 14-10-17 om 14:54 schreef Satoru Takeuchi:
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience
2017-10-14 12:54 [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience Satoru Takeuchi
2017-10-14 16:19 ` Koen Kooi
@ 2017-10-17 18:16 ` David Sterba
1 sibling, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-10-17 18:16 UTC (permalink / raw)
To: Satoru Takeuchi; +Cc: linux-btrfs
On Sat, Oct 14, 2017 at 09:54:54PM +0900, Satoru Takeuchi wrote:
> 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 <satoru.takeuchi@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-17 18:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-14 12:54 [PATCH RESEND] btrfs-progs: allow "no" to disable compression for convenience Satoru Takeuchi
2017-10-14 16:19 ` Koen Kooi
2017-10-14 23:02 ` Satoru Takeuchi
2017-10-17 18:16 ` David Sterba
2017-10-17 18:16 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).