From: Eugene Syromiatnikov <esyr@redhat.com>
To: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org,
David Sterba <dsterba@suse.com>,
Josef Bacik <josef@toxicpanda.com>, Chris Mason <clm@fb.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] btrfs: move enum btrfs_compression_type to the UAPI header
Date: Sun, 19 Apr 2020 12:14:32 +0200 [thread overview]
Message-ID: <20200419101432.GA32249@asgard.redhat.com> (raw)
It is passed in struct btrfs_ioctl_defrag_range_args.compress_type
to BTRFS_IOC_DEFRAG_RANGE, so it has to be a part of UAPI.
Also, rely on enum definition rules to get BTRFS_NR_COMPRESS_TYPES
value and mark it as non-ABI.
Complements: 33ca913349962208 ("btrfs: uapi/linux/btrfs.h migration, move struct btrfs_ioctl_defrag_range_args")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
---
fs/btrfs/compression.h | 9 +--------
include/uapi/linux/btrfs.h | 10 ++++++++++
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index d253f7a..3483b26 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -6,6 +6,7 @@
#ifndef BTRFS_COMPRESSION_H
#define BTRFS_COMPRESSION_H
+#include <linux/btrfs.h>
#include <linux/sizes.h>
/*
@@ -100,14 +101,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
unsigned int btrfs_compress_str2level(unsigned int type, const char *str);
-enum btrfs_compression_type {
- BTRFS_COMPRESS_NONE = 0,
- BTRFS_COMPRESS_ZLIB = 1,
- BTRFS_COMPRESS_LZO = 2,
- BTRFS_COMPRESS_ZSTD = 3,
- BTRFS_NR_COMPRESS_TYPES = 4,
-};
-
struct workspace_manager {
struct list_head idle_ws;
spinlock_t ws_lock;
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index e6b6cb0f..82cc9ac 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -558,6 +558,16 @@ struct btrfs_ioctl_clone_range_args {
*/
#define BTRFS_DEFRAG_RANGE_COMPRESS 1
#define BTRFS_DEFRAG_RANGE_START_IO 2
+
+enum btrfs_compression_type {
+ BTRFS_COMPRESS_NONE = 0,
+ BTRFS_COMPRESS_ZLIB = 1,
+ BTRFS_COMPRESS_LZO = 2,
+ BTRFS_COMPRESS_ZSTD = 3,
+
+ BTRFS_NR_COMPRESS_TYPES /* non-ABI */
+};
+
struct btrfs_ioctl_defrag_range_args {
/* start of the defrag operation */
__u64 start;
--
2.1.4
next reply other threads:[~2020-04-19 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 10:14 Eugene Syromiatnikov [this message]
2020-04-20 22:10 ` [PATCH] btrfs: move enum btrfs_compression_type to the UAPI header David Sterba
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=20200419101432.GA32249@asgard.redhat.com \
--to=esyr@redhat.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=jeffm@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 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).