From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 2/4] btrfs: convert enum btrfs_compression_type to define
Date: Sun, 13 Aug 2017 12:02:42 +0800 [thread overview]
Message-ID: <20170813040244.18841-3-anand.jain@oracle.com> (raw)
In-Reply-To: <20170813040244.18841-1-anand.jain@oracle.com>
There isn't a huge list to manage the types, which can be managed
with defines. It helps to easily print the types in tracing as well.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/compression.h | 7 -------
fs/btrfs/super.c | 2 +-
include/uapi/linux/btrfs_tree.h | 5 +++++
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index e749df6dd39a..f28a501e7828 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -95,13 +95,6 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start,
blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
int mirror_num, unsigned long bio_flags);
-enum btrfs_compression_type {
- BTRFS_COMPRESS_NONE = 0,
- BTRFS_COMPRESS_ZLIB = 1,
- BTRFS_COMPRESS_LZO = 2,
- BTRFS_COMPRESS_TYPES = 2,
-};
-
struct btrfs_compress_op {
struct list_head *(*alloc_workspace)(void);
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 12540b6104b5..b711357352f8 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -404,7 +404,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
int ret = 0;
char *compress_type;
bool compress_force = false;
- enum btrfs_compression_type saved_compress_type;
+ unsigned int saved_compress_type;
bool saved_compress_force;
int no_compress = 0;
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 10689e1fdf11..7a1fec2d10ab 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -733,6 +733,11 @@ struct btrfs_balance_item {
#define BTRFS_FILE_EXTENT_REG 1
#define BTRFS_FILE_EXTENT_PREALLOC 2
+#define BTRFS_COMPRESS_NONE 0
+#define BTRFS_COMPRESS_TYPES 2
+#define BTRFS_COMPRESS_ZLIB 1
+#define BTRFS_COMPRESS_LZO 2
+
struct btrfs_file_extent_item {
/*
* transaction id that created this extent
--
2.13.1
next prev parent reply other threads:[~2017-08-13 3:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-13 4:02 [PATCH 0/4] misc compression tracing related patches Anand Jain
2017-08-13 4:02 ` [PATCH 1/4] btrfs: remove unused BTRFS_COMPRESS_LAST Anand Jain
2017-08-16 13:57 ` David Sterba
2017-08-13 4:02 ` Anand Jain [this message]
2017-08-16 13:59 ` [PATCH 2/4] btrfs: convert enum btrfs_compression_type to define David Sterba
2017-08-16 20:33 ` Anand Jain
2017-08-17 11:57 ` David Sterba
2017-08-30 14:38 ` Anand Jain
2017-09-07 18:52 ` David Sterba
2017-08-13 4:02 ` [PATCH 3/4] btrfs: decode compress type for tracing Anand Jain
2017-08-16 14:03 ` David Sterba
2017-08-13 4:02 ` [PATCH 4/4 v3] btrfs: add compression trace points Anand Jain
2017-08-15 21:09 ` kbuild test robot
2017-08-16 14:38 ` David Sterba
2017-08-16 21:24 ` [PATCH 4/4 v4] " Anand Jain
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=20170813040244.18841-3-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@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).