Thread (26 messages) 26 messages, 2 authors, 2019-12-05

Re: [RFC PATCH v3 03/12] fs: add RWF_ENCODED for reading/writing compressed data

flat view

From: Omar Sandoval <osandov@osandov.com>
Date: 2019-11-26 17:36:15
Also in: linux-btrfs, linux-fsdevel

On Tue, Nov 26, 2019 at 03:53:02PM +0200, Nikolay Borisov wrote:

On 20.11.19 г. 20:24 ч., Omar Sandoval wrote:
quoted
From: Omar Sandoval <redacted>
<snip>
quoted
 
+enum {
+	ENCODED_IOV_COMPRESSION_NONE,
+#define ENCODED_IOV_COMPRESSION_NONE ENCODED_IOV_COMPRESSION_NONE
+	ENCODED_IOV_COMPRESSION_ZLIB,
+#define ENCODED_IOV_COMPRESSION_ZLIB ENCODED_IOV_COMPRESSION_ZLIB
+	ENCODED_IOV_COMPRESSION_LZO,
+#define ENCODED_IOV_COMPRESSION_LZO ENCODED_IOV_COMPRESSION_LZO
+	ENCODED_IOV_COMPRESSION_ZSTD,
+#define ENCODED_IOV_COMPRESSION_ZSTD ENCODED_IOV_COMPRESSION_ZSTD
+	ENCODED_IOV_COMPRESSION_TYPES = ENCODED_IOV_COMPRESSION_ZSTD,
This looks very dodgy, what am I missing?
This is a somewhat common trick so that enum values can be checked for
with ifdef/ifndef. See include/uapi/linux.in.h, for example.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help