From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Mike Fleetwood <mike.fleetwood@googlemail.com>
Cc: Satoru Takeuchi <satoru.takeuchi@gmail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: [PATCH v2] btrfs-progs: allow "none" to disable compression for convenience
Date: Mon, 18 Sep 2017 09:41:17 +0900 [thread overview]
Message-ID: <8760cgalea.wl-satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <CAMU1PDiJofgOQZ3g5Fq35huWuPp7fKFdC+KR2KjCkqGrP9aUzw@mail.gmail.com>
At Sun, 17 Sep 2017 14:08:40 +0100,
Mike Fleetwood wrote:
>
> On 17 September 2017 at 01:36, Satoru Takeuchi
> <satoru.takeuchi@gmail.com> wrote:
> > It's messy to use "" to disable compression. Introduce the new value "no"
> > which can also be used for this purpose.
>
> From an English language point of view, "none" would be better. None
> says the absence of, where as no is more general negative.
Thank you for your comment. How about is it?
---
It's messy to use "" to disable compression. Introduce the new value "none"
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..786af9b 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, none, or "" (empty string). Both none 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..8d85181 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, "none"))
+ 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
next prev parent reply other threads:[~2017-09-18 0:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-17 0:36 [PATCH] btrfs-progs: allow "no" to disable compression for convenience Satoru Takeuchi
2017-09-17 13:08 ` Mike Fleetwood
2017-09-18 0:41 ` Satoru Takeuchi [this message]
2017-09-19 15:14 ` [PATCH v2] btrfs-progs: allow "none" " David Sterba
2017-09-20 2:03 ` Satoru Takeuchi
2017-10-14 23:35 ` Satoru Takeuchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8760cgalea.wl-satoru.takeuchi@gmail.com \
--to=satoru.takeuchi@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mike.fleetwood@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.