]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
authorPetr Vorel <pvorel@suse.cz>
Tue, 7 May 2024 15:37:57 +0000 (17:37 +0200)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:29:24 +0000 (17:29 -0400)
Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under
BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the
definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC.

There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC,
which use UUID_INIT() and are used only in libbcachefs. Therefore move
only BCACHEFS_STATFS_MAGIC value, which can be used outside of
libbcachefs for f_type field in struct statfs in statfs() or fstatfs().

Suggested-by: Su Yue <glass.su@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs_format.h
include/uapi/linux/magic.h

index d5b90439e581f48c52f129e603a73567b868ff22..1bebba881d8997135cf4b7eee77721e97049a97b 100644 (file)
@@ -76,6 +76,7 @@
 #include <asm/byteorder.h>
 #include <linux/kernel.h>
 #include <linux/uuid.h>
+#include <uapi/linux/magic.h>
 #include "vstructs.h"
 
 #ifdef __KERNEL__
@@ -1290,7 +1291,7 @@ enum bch_compression_opts {
        UUID_INIT(0xc68573f6, 0x66ce, 0x90a9,                           \
                  0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
 
-#define BCACHEFS_STATFS_MAGIC          0xca451a4e
+#define BCACHEFS_STATFS_MAGIC          BCACHEFS_SUPER_MAGIC
 
 #define JSET_MAGIC             __cpu_to_le64(0x245235c1a3625032ULL)
 #define BSET_MAGIC             __cpu_to_le64(0x90135c78b99e07f5ULL)
index 1b40a968ba91fc9d2d0a8339261584a0d89ff9a9..bb575f3ab45e59aff283602f8e7c8af13e8bcc6a 100644 (file)
@@ -37,6 +37,7 @@
 #define HOSTFS_SUPER_MAGIC     0x00c0ffee
 #define OVERLAYFS_SUPER_MAGIC  0x794c7630
 #define FUSE_SUPER_MAGIC       0x65735546
+#define BCACHEFS_SUPER_MAGIC   0xca451a4e
 
 #define MINIX_SUPER_MAGIC      0x137F          /* minix v1 fs, 14 char names */
 #define MINIX_SUPER_MAGIC2     0x138F          /* minix v1 fs, 30 char names */