Skip to content

Commit e2f48c4

Browse files
pevikKent Overstreet
authored andcommitted
bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h
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 <[email protected]> Signed-off-by: Petr Vorel <[email protected]> Acked-by: Brian Foster <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent e11ecc6 commit e2f48c4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/bcachefs/bcachefs_format.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#include <asm/byteorder.h>
7777
#include <linux/kernel.h>
7878
#include <linux/uuid.h>
79+
#include <uapi/linux/magic.h>
7980
#include "vstructs.h"
8081

8182
#ifdef __KERNEL__
@@ -1290,7 +1291,7 @@ enum bch_compression_opts {
12901291
UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \
12911292
0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
12921293

1293-
#define BCACHEFS_STATFS_MAGIC 0xca451a4e
1294+
#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC
12941295

12951296
#define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL)
12961297
#define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL)

include/uapi/linux/magic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
3838
#define OVERLAYFS_SUPER_MAGIC 0x794c7630
3939
#define FUSE_SUPER_MAGIC 0x65735546
40+
#define BCACHEFS_SUPER_MAGIC 0xca451a4e
4041

4142
#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
4243
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */

0 commit comments

Comments
 (0)