* [PATCH 01/22] cifs: move CIFS_MAGIC_NUMBER to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 02/22] xfs: add XFS_SUPER_MAGIC " Karel Zak
` (21 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Steve French
Move the magic number to proper place.
CC: Steve French <sfrench@samba.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/cifs/cifsglob.h | 3 +--
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index cf32f03..af70538 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -22,6 +22,7 @@
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/slab.h>
+#include <linux/magic.h>
#include <linux/mempool.h>
#include <linux/workqueue.h>
#include "cifs_fs_sb.h"
@@ -33,8 +34,6 @@
#include "smb2pdu.h"
#endif
-#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
-
/*
* The sizes of various internal tables and strings
*/
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 77c6031..343ea0c 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -5,6 +5,7 @@
#define AFFS_SUPER_MAGIC 0xadff
#define AFS_SUPER_MAGIC 0x5346414F
#define AUTOFS_SUPER_MAGIC 0x0187
+#define CIFS_MAGIC_NUMBER 0xff534d42
#define CODA_SUPER_MAGIC 0x73757245
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 02/22] xfs: add XFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
2014-03-04 10:00 ` [PATCH 01/22] cifs: move CIFS_MAGIC_NUMBER to <linux/magic.h> Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 11:10 ` Dave Chinner
2014-03-04 10:00 ` [PATCH 03/22] ipc/mqueue: move MQUEUE_MAGIC " Karel Zak
` (20 subsequent siblings)
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Dave Chinner
Move the magic number to proper place as it's exported by
statfs.f_type to userspace.
CC: Dave Chinner <david@fromorbit.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/xfs/xfs_sb.h | 4 +++-
include/uapi/linux/magic.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
index 35061d4..e4c44fa 100644
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -18,6 +18,8 @@
#ifndef __XFS_SB_H__
#define __XFS_SB_H__
+#include <linux/magic.h>
+
/*
* Super block
* Fits into a sector-sized buffer at address 0 of each allocation group.
@@ -28,7 +30,7 @@ struct xfs_buf;
struct xfs_mount;
struct xfs_trans;
-#define XFS_SB_MAGIC 0x58465342 /* 'XFSB' */
+#define XFS_SB_MAGIC XFS_SUPER_MAGIC /* see linux/magic.h */
#define XFS_SB_VERSION_1 1 /* 5.3, 6.0.1, 6.1 */
#define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
#define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 343ea0c..c9b516dd 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -32,6 +32,7 @@
#define PSTOREFS_MAGIC 0x6165676C
#define EFIVARFS_MAGIC 0xde5e81e4
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
+#define XFS_SUPER_MAGIC 0x58465342
#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 02/22] xfs: add XFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 02/22] xfs: add XFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 11:10 ` Dave Chinner
0 siblings, 0 replies; 35+ messages in thread
From: Dave Chinner @ 2014-03-04 11:10 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
On Tue, Mar 04, 2014 at 11:00:38AM +0100, Karel Zak wrote:
> Move the magic number to proper place as it's exported by
> statfs.f_type to userspace.
It is in it's proper place. It's an on-disk definition not a
userspace API definition. So, for the reasons I've already
outlined w.r.t. to coupling userspace APIs and on-disk format
definitions being Bad Thing, NACK.
> CC: Dave Chinner <david@fromorbit.com>
> Signed-off-by: Karel Zak <kzak@redhat.com>
> ---
> fs/xfs/xfs_sb.h | 4 +++-
> include/uapi/linux/magic.h | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
> index 35061d4..e4c44fa 100644
> --- a/fs/xfs/xfs_sb.h
> +++ b/fs/xfs/xfs_sb.h
> @@ -18,6 +18,8 @@
> #ifndef __XFS_SB_H__
> #define __XFS_SB_H__
>
> +#include <linux/magic.h>
> +
> /*
> * Super block
> * Fits into a sector-sized buffer at address 0 of each allocation group.
> @@ -28,7 +30,7 @@ struct xfs_buf;
> struct xfs_mount;
> struct xfs_trans;
>
> -#define XFS_SB_MAGIC 0x58465342 /* 'XFSB' */
> +#define XFS_SB_MAGIC XFS_SUPER_MAGIC /* see linux/magic.h */
> #define XFS_SB_VERSION_1 1 /* 5.3, 6.0.1, 6.1 */
> #define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
> #define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
FYI, this file (along with all the other on-disk format definitions
and the core XFS code to read, modify and write it) is shared with
the userspace xfsprogs code, so it needs the on-disk magic number to
be defined in this file. It also means we don't include random
header files from within other header files - we use explicit
includes in the .c files or, for generic headers needed everywhere,
consolidate them in fs/xfs/xfs_linux.h.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 03/22] ipc/mqueue: move MQUEUE_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
2014-03-04 10:00 ` [PATCH 01/22] cifs: move CIFS_MAGIC_NUMBER to <linux/magic.h> Karel Zak
2014-03-04 10:00 ` [PATCH 02/22] xfs: add XFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 04/22] configfs: move CONFIGFS_MAGIC " Karel Zak
` (19 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/uapi/linux/magic.h | 1 +
ipc/mqueue.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index c9b516dd..566788e 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -10,6 +10,7 @@
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
#define DEBUGFS_MAGIC 0x64626720
+#define MQUEUE_MAGIC 0x19800202
#define SECURITYFS_MAGIC 0x73636673
#define SELINUX_MAGIC 0xf97cff8c
#define SMACK_MAGIC 0x43415d53 /* "SMAC" */
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index c3b3117..2d4881d 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -35,11 +35,11 @@
#include <linux/ipc_namespace.h>
#include <linux/user_namespace.h>
#include <linux/slab.h>
+#include <linux/magic.h>
#include <net/sock.h>
#include "util.h"
-#define MQUEUE_MAGIC 0x19800202
#define DIRENT_SIZE 20
#define FILENT_SIZE 80
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 04/22] configfs: move CONFIGFS_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (2 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 03/22] ipc/mqueue: move MQUEUE_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 05/22] befs: move BEFS_SUPER_MAGIC " Karel Zak
` (18 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/configfs/mount.c | 4 +---
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index 7f26c3c..e7b80af 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -30,13 +30,11 @@
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/magic.h>
#include <linux/configfs.h>
#include "configfs_internal.h"
-/* Random magic number */
-#define CONFIGFS_MAGIC 0x62656570
-
static struct vfsmount *configfs_mount = NULL;
struct kmem_cache *configfs_dir_cachep;
static int configfs_mnt_count = 0;
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 566788e..12bac3f 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -7,6 +7,7 @@
#define AUTOFS_SUPER_MAGIC 0x0187
#define CIFS_MAGIC_NUMBER 0xff534d42
#define CODA_SUPER_MAGIC 0x73757245
+#define CONFIGFS_MAGIC 0x62656570 /* some random number */
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
#define DEBUGFS_MAGIC 0x64626720
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 05/22] befs: move BEFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (3 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 04/22] configfs: move CONFIGFS_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 06/22] bfs: move BFS_MAGIC " Karel Zak
` (17 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/befs/befs_fs_types.h | 5 +++--
include/uapi/linux/magic.h | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h
index eb557d9..0c422db 100644
--- a/fs/befs/befs_fs_types.h
+++ b/fs/befs/befs_fs_types.h
@@ -16,8 +16,10 @@
#ifdef __KERNEL__
#include <linux/types.h>
+#include <linux/magic.h>
#endif /*__KERNEL__*/
+
#define PACKED __attribute__ ((__packed__))
/*
@@ -49,7 +51,7 @@ enum super_flags {
BEFS_BYTESEX_LE,
BEFS_CLEAN = 0x434c454e,
BEFS_DIRTY = 0x44495254,
- BEFS_SUPER_MAGIC1 = 0x42465331, /* BFS1 */
+ BEFS_SUPER_MAGIC1 = BEFS_SUPER_MAGIC /* see linux/magic.h */
BEFS_SUPER_MAGIC2 = 0xdd121031,
BEFS_SUPER_MAGIC3 = 0x15b6830e,
};
@@ -58,7 +60,6 @@ enum super_flags {
#define BEFS_BYTEORDER_NATIVE_LE (__force fs32)cpu_to_le32(BEFS_BYTEORDER_NATIVE)
#define BEFS_BYTEORDER_NATIVE_BE (__force fs32)cpu_to_be32(BEFS_BYTEORDER_NATIVE)
-#define BEFS_SUPER_MAGIC BEFS_SUPER_MAGIC1
#define BEFS_SUPER_MAGIC1_LE (__force fs32)cpu_to_le32(BEFS_SUPER_MAGIC1)
#define BEFS_SUPER_MAGIC1_BE (__force fs32)cpu_to_be32(BEFS_SUPER_MAGIC1)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 12bac3f..ba3be09 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -5,6 +5,7 @@
#define AFFS_SUPER_MAGIC 0xadff
#define AFS_SUPER_MAGIC 0x5346414F
#define AUTOFS_SUPER_MAGIC 0x0187
+#define BEFS_SUPER_MAGIC 0x42465331 /* "BFS1" */
#define CIFS_MAGIC_NUMBER 0xff534d42
#define CODA_SUPER_MAGIC 0x73757245
#define CONFIGFS_MAGIC 0x62656570 /* some random number */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 06/22] bfs: move BFS_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (4 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 05/22] befs: move BEFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 07/22] ceph: move CEPH_SUPER_MAGIC " Karel Zak
` (16 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Tigran A. Aivazian
Move the magic number to proper place.
CC: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/uapi/linux/bfs_fs.h | 2 +-
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/bfs_fs.h b/include/uapi/linux/bfs_fs.h
index 1c0b355..bba7fbf 100644
--- a/include/uapi/linux/bfs_fs.h
+++ b/include/uapi/linux/bfs_fs.h
@@ -7,11 +7,11 @@
#define _LINUX_BFS_FS_H
#include <linux/types.h>
+#include <linux/magic.h>
#define BFS_BSIZE_BITS 9
#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
-#define BFS_MAGIC 0x1BADFACE
#define BFS_ROOT_INO 2
#define BFS_INODES_PER_BLOCK 8
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index ba3be09..55d9825 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -6,6 +6,7 @@
#define AFS_SUPER_MAGIC 0x5346414F
#define AUTOFS_SUPER_MAGIC 0x0187
#define BEFS_SUPER_MAGIC 0x42465331 /* "BFS1" */
+#define BFS_MAGIC 0x1BADFACE
#define CIFS_MAGIC_NUMBER 0xff534d42
#define CODA_SUPER_MAGIC 0x73757245
#define CONFIGFS_MAGIC 0x62656570 /* some random number */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 07/22] ceph: move CEPH_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (5 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 06/22] bfs: move BFS_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 08/22] exofs: move EXOFS_SUPER_MAGIC " Karel Zak
` (15 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Sage Weil
Move the magic number to proper place.
CC: Sage Weil <sage@inktank.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/ceph/super.h | 4 +---
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index d8801a9..0d5881c 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -14,6 +14,7 @@
#include <linux/writeback.h>
#include <linux/slab.h>
#include <linux/posix_acl.h>
+#include <linux/magic.h>
#include <linux/ceph/libceph.h>
@@ -21,9 +22,6 @@
#include <linux/fscache.h>
#endif
-/* f_type in struct statfs */
-#define CEPH_SUPER_MAGIC 0x00c36400
-
/* large granularity for statfs utilization stats to facilitate
* large volume sizes on 32-bit machines. */
#define CEPH_BLOCK_SHIFT 22 /* 4 MB */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 55d9825..ecaf6f7 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -7,6 +7,7 @@
#define AUTOFS_SUPER_MAGIC 0x0187
#define BEFS_SUPER_MAGIC 0x42465331 /* "BFS1" */
#define BFS_MAGIC 0x1BADFACE
+#define CEPH_SUPER_MAGIC 0x00c36400
#define CIFS_MAGIC_NUMBER 0xff534d42
#define CODA_SUPER_MAGIC 0x73757245
#define CONFIGFS_MAGIC 0x62656570 /* some random number */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 08/22] exofs: move EXOFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (6 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 07/22] ceph: move CEPH_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-04-03 8:54 ` Boaz Harrosh
2014-03-04 10:00 ` [PATCH 09/22] freevxfs: move VXFS_SUPER_MAGIC " Karel Zak
` (14 subsequent siblings)
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Boaz Harrosh
Move the magic number to proper place.
CC: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/exofs/common.h | 2 +-
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/exofs/common.h b/fs/exofs/common.h
index 3bbd469..93c3a89 100644
--- a/fs/exofs/common.h
+++ b/fs/exofs/common.h
@@ -37,6 +37,7 @@
#define __EXOFS_COM_H__
#include <linux/types.h>
+#include <linux/magic.h>
#include <scsi/osd_attributes.h>
#include <scsi/osd_initiator.h>
@@ -82,7 +83,6 @@ enum {
/****************************************************************************
* superblock-related things
****************************************************************************/
-#define EXOFS_SUPER_MAGIC 0x5DF5
/*
* The file system control block - stored in object EXOFS_SUPER_ID's data.
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index ecaf6f7..0c91e37 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -24,6 +24,7 @@
#define SQUASHFS_MAGIC 0x73717368
#define ECRYPTFS_SUPER_MAGIC 0xf15f
#define EFS_SUPER_MAGIC 0x414A53
+#define EXOFS_SUPER_MAGIC 0x5DF5
#define EXT2_SUPER_MAGIC 0xEF53
#define EXT3_SUPER_MAGIC 0xEF53
#define XENFS_SUPER_MAGIC 0xabba1974
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 08/22] exofs: move EXOFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 08/22] exofs: move EXOFS_SUPER_MAGIC " Karel Zak
@ 2014-04-03 8:54 ` Boaz Harrosh
0 siblings, 0 replies; 35+ messages in thread
From: Boaz Harrosh @ 2014-04-03 8:54 UTC (permalink / raw)
To: Karel Zak, Al Viro; +Cc: linux-fsdevel
On 03/04/2014 12:00 PM, Karel Zak wrote:
> Move the magic number to proper place.
>
> CC: Boaz Harrosh <bharrosh@panasas.com>
- CC: Boaz Harrosh <bharrosh@panasas.com>
+ ACK-by: Boaz Harrosh <bharrosh@panasas.com>
Are you pushing this or you need that I push it through the exofs tree?
BTW: does anyone know - Today I need to do:
mount -t exofs /dev/osdX /mnt
How to teach the Kernel to send any osd devices to exofs
when -t is not specified?
Thanks
Boaz
> Signed-off-by: Karel Zak <kzak@redhat.com>
> ---
> fs/exofs/common.h | 2 +-
> include/uapi/linux/magic.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/exofs/common.h b/fs/exofs/common.h
> index 3bbd469..93c3a89 100644
> --- a/fs/exofs/common.h
> +++ b/fs/exofs/common.h
> @@ -37,6 +37,7 @@
> #define __EXOFS_COM_H__
>
> #include <linux/types.h>
> +#include <linux/magic.h>
>
> #include <scsi/osd_attributes.h>
> #include <scsi/osd_initiator.h>
> @@ -82,7 +83,6 @@ enum {
> /****************************************************************************
> * superblock-related things
> ****************************************************************************/
> -#define EXOFS_SUPER_MAGIC 0x5DF5
>
> /*
> * The file system control block - stored in object EXOFS_SUPER_ID's data.
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index ecaf6f7..0c91e37 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -24,6 +24,7 @@
> #define SQUASHFS_MAGIC 0x73717368
> #define ECRYPTFS_SUPER_MAGIC 0xf15f
> #define EFS_SUPER_MAGIC 0x414A53
> +#define EXOFS_SUPER_MAGIC 0x5DF5
> #define EXT2_SUPER_MAGIC 0xEF53
> #define EXT3_SUPER_MAGIC 0xEF53
> #define XENFS_SUPER_MAGIC 0xabba1974
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 09/22] freevxfs: move VXFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (7 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 08/22] exofs: move EXOFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 17:26 ` Christoph Hellwig
2014-03-04 10:00 ` [PATCH 10/22] fuse: move FUSE_SUPER_MAGIC " Karel Zak
` (13 subsequent siblings)
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Christoph Hellwig
Move the magic number to proper place.
CC: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/freevxfs/vxfs.h | 6 +-----
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/freevxfs/vxfs.h b/fs/freevxfs/vxfs.h
index c8a9265..165d3c6 100644
--- a/fs/freevxfs/vxfs.h
+++ b/fs/freevxfs/vxfs.h
@@ -37,6 +37,7 @@
* superblocks of the Veritas Filesystem.
*/
#include <linux/types.h>
+#include <linux/magic.h>
/*
@@ -46,11 +47,6 @@ typedef int32_t vx_daddr_t;
typedef int32_t vx_ino_t;
/*
- * Superblock magic number (vxfs_super->vs_magic).
- */
-#define VXFS_SUPER_MAGIC 0xa501FCF5
-
-/*
* The root inode.
*/
#define VXFS_ROOT_INO 2
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 0c91e37..a55b22a 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -38,6 +38,7 @@
#define PSTOREFS_MAGIC 0x6165676C
#define EFIVARFS_MAGIC 0xde5e81e4
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
+#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 10/22] fuse: move FUSE_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (8 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 09/22] freevxfs: move VXFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 11/22] gfs2: move GFS2_MAGIC " Karel Zak
` (12 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Miklos Szeredi
Move the magic number to proper place.
CC: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/fuse/inode.c | 3 +--
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index d468643..7fab248 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -20,6 +20,7 @@
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/exportfs.h>
+#include <linux/magic.h>
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -47,8 +48,6 @@ MODULE_PARM_DESC(max_user_congthresh,
"Global limit for the maximum congestion threshold an "
"unprivileged user can set");
-#define FUSE_SUPER_MAGIC 0x65735546
-
#define FUSE_DEFAULT_BLKSIZE 512
/** Maximum number of outstanding background requests */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index a55b22a..f8ccce1 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -29,6 +29,7 @@
#define EXT3_SUPER_MAGIC 0xEF53
#define XENFS_SUPER_MAGIC 0xabba1974
#define EXT4_SUPER_MAGIC 0xEF53
+#define FUSE_SUPER_MAGIC 0x65735546
#define BTRFS_SUPER_MAGIC 0x9123683E
#define NILFS_SUPER_MAGIC 0x3434
#define F2FS_SUPER_MAGIC 0xF2F52010
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 11/22] gfs2: move GFS2_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (9 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 10/22] fuse: move FUSE_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-06 10:23 ` Steven Whitehouse
2014-03-04 10:00 ` [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC " Karel Zak
` (11 subsequent siblings)
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Steven Whitehouse
Move the magic number to proper place.
CC: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/uapi/linux/gfs2_ondisk.h | 2 +-
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h
index 0f24c07..06a05d9 100644
--- a/include/uapi/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
@@ -11,8 +11,8 @@
#define __GFS2_ONDISK_DOT_H__
#include <linux/types.h>
+#include <linux/magic.h>
-#define GFS2_MAGIC 0x01161970
#define GFS2_BASIC_BLOCK 512
#define GFS2_BASIC_BLOCK_SHIFT 9
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index f8ccce1..14f2a96 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -14,6 +14,7 @@
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
#define DEBUGFS_MAGIC 0x64626720
+#define GFS2_MAGIC 0x01161970
#define MQUEUE_MAGIC 0x19800202
#define SECURITYFS_MAGIC 0x73636673
#define SELINUX_MAGIC 0xf97cff8c
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 11/22] gfs2: move GFS2_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 11/22] gfs2: move GFS2_MAGIC " Karel Zak
@ 2014-03-06 10:23 ` Steven Whitehouse
0 siblings, 0 replies; 35+ messages in thread
From: Steven Whitehouse @ 2014-03-06 10:23 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
Hi,
On Tue, 2014-03-04 at 11:00 +0100, Karel Zak wrote:
> Move the magic number to proper place.
>
I'm not convinced that it makes sense to move this to a shared header,
outside of gfs2_ondisk.h unless it is needed by some other subsystem or
component. That doesn't appear to be the case here,
Steve.
> CC: Steven Whitehouse <swhiteho@redhat.com>
> Signed-off-by: Karel Zak <kzak@redhat.com>
> ---
> include/uapi/linux/gfs2_ondisk.h | 2 +-
> include/uapi/linux/magic.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h
> index 0f24c07..06a05d9 100644
> --- a/include/uapi/linux/gfs2_ondisk.h
> +++ b/include/uapi/linux/gfs2_ondisk.h
> @@ -11,8 +11,8 @@
> #define __GFS2_ONDISK_DOT_H__
>
> #include <linux/types.h>
> +#include <linux/magic.h>
>
> -#define GFS2_MAGIC 0x01161970
> #define GFS2_BASIC_BLOCK 512
> #define GFS2_BASIC_BLOCK_SHIFT 9
>
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index f8ccce1..14f2a96 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -14,6 +14,7 @@
> #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
> #define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
> #define DEBUGFS_MAGIC 0x64626720
> +#define GFS2_MAGIC 0x01161970
> #define MQUEUE_MAGIC 0x19800202
> #define SECURITYFS_MAGIC 0x73636673
> #define SELINUX_MAGIC 0xf97cff8c
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (10 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 11/22] gfs2: move GFS2_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:23 ` Vyacheslav Dubeyko
2014-03-04 17:26 ` Christoph Hellwig
2014-03-04 10:00 ` [PATCH 13/22] hppfs: move HPPFS_SUPER_MAGIC " Karel Zak
` (10 subsequent siblings)
22 siblings, 2 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/hfsplus/hfsplus_raw.h | 2 +-
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h
index 8ffb3a8..73b2701 100644
--- a/fs/hfsplus/hfsplus_raw.h
+++ b/fs/hfsplus/hfsplus_raw.h
@@ -14,6 +14,7 @@
#define _LINUX_HFSPLUS_RAW_H
#include <linux/types.h>
+#include <linux/magic.h>
/* Some constants */
#define HFSPLUS_SECTOR_SIZE 512
@@ -21,7 +22,6 @@
#define HFSPLUS_VOLHEAD_SECTOR 2
#define HFSPLUS_VOLHEAD_SIG 0x482b
#define HFSPLUS_VOLHEAD_SIGX 0x4858
-#define HFSPLUS_SUPER_MAGIC 0x482b
#define HFSPLUS_MIN_VERSION 4
#define HFSPLUS_CURRENT_VERSION 5
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 14f2a96..4980428 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -39,6 +39,7 @@
#define JFFS2_SUPER_MAGIC 0x72b6
#define PSTOREFS_MAGIC 0x6165676C
#define EFIVARFS_MAGIC 0xde5e81e4
+#define HFSPLUS_SUPER_MAGIC 0x482b
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:23 ` Vyacheslav Dubeyko
2014-03-04 17:26 ` Christoph Hellwig
1 sibling, 0 replies; 35+ messages in thread
From: Vyacheslav Dubeyko @ 2014-03-04 10:23 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
On Tue, 2014-03-04 at 11:00 +0100, Karel Zak wrote:
> Move the magic number to proper place.
>
> Signed-off-by: Karel Zak <kzak@redhat.com>
> ---
> fs/hfsplus/hfsplus_raw.h | 2 +-
> include/uapi/linux/magic.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h
> index 8ffb3a8..73b2701 100644
> --- a/fs/hfsplus/hfsplus_raw.h
> +++ b/fs/hfsplus/hfsplus_raw.h
> @@ -14,6 +14,7 @@
> #define _LINUX_HFSPLUS_RAW_H
>
> #include <linux/types.h>
> +#include <linux/magic.h>
>
> /* Some constants */
> #define HFSPLUS_SECTOR_SIZE 512
> @@ -21,7 +22,6 @@
> #define HFSPLUS_VOLHEAD_SECTOR 2
> #define HFSPLUS_VOLHEAD_SIG 0x482b
> #define HFSPLUS_VOLHEAD_SIGX 0x4858
> -#define HFSPLUS_SUPER_MAGIC 0x482b
Frankly speaking, HFSPLUS_VOLHEAD_SIGX is also magic number. The
HFSPLUS_SUPER_MAGIC ('H+') is magic for HFS+ volumes. And
HFSPLUS_VOLHEAD_SIGX ('HX') is magic for HFSX volumes.
But, moreover, as I can see HFSPLUS_VOLHEAD_SIG is synonym for
HFSPLUS_SUPER_MAGIC. And it is used more frequently in HFS+ driver code.
So, maybe, it makes sense to clean up duplication in declarations.
Thanks,
Vyacheslav Dubeyko.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC " Karel Zak
2014-03-04 10:23 ` Vyacheslav Dubeyko
@ 2014-03-04 17:26 ` Christoph Hellwig
1 sibling, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2014-03-04 17:26 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
On Tue, Mar 04, 2014 at 11:00:48AM +0100, Karel Zak wrote:
> Move the magic number to proper place.
NAK. It's already in the proper place. Your whole series is a move in
the wrong direction.
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 13/22] hppfs: move HPPFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (11 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 12/22] hfsplus: move HFSPLUS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 14/22] jfs: move JFS_SUPER_MAGIC " Karel Zak
` (9 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/hppfs/hppfs.c | 3 +--
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 4338ff3..7bcac0a 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -17,6 +17,7 @@
#include <linux/types.h>
#include <linux/pid_namespace.h>
#include <linux/namei.h>
+#include <linux/magic.h>
#include <asm/uaccess.h>
#include <os.h>
@@ -44,8 +45,6 @@ static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode)
return container_of(inode, struct hppfs_inode_info, vfs_inode);
}
-#define HPPFS_SUPER_MAGIC 0xb00000ee
-
static const struct super_operations hppfs_sbops;
static int is_pid(struct dentry *dentry)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 4980428..641dcea 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -41,6 +41,7 @@
#define EFIVARFS_MAGIC 0xde5e81e4
#define HFSPLUS_SUPER_MAGIC 0x482b
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
+#define HPPFS_SUPER_MAGIC 0xb00000ee
#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 14/22] jfs: move JFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (12 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 13/22] hppfs: move HPPFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 15/22] logfs: add LOGFS_FTYPE_MAGIC " Karel Zak
` (8 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Dave Kleikamp
Move the magic number to proper place.
CC: Dave Kleikamp <shaggy@kernel.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/jfs/jfs_incore.h | 6 +-----
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h
index cf47f09..60998dd 100644
--- a/fs/jfs/jfs_incore.h
+++ b/fs/jfs/jfs_incore.h
@@ -23,16 +23,12 @@
#include <linux/rwsem.h>
#include <linux/slab.h>
#include <linux/bitops.h>
+#include <linux/magic.h>
#include "jfs_types.h"
#include "jfs_xtree.h"
#include "jfs_dtree.h"
/*
- * JFS magic number
- */
-#define JFS_SUPER_MAGIC 0x3153464a /* "JFS1" */
-
-/*
* JFS-private inode information
*/
struct jfs_inode_info {
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 641dcea..7898d5d 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -37,6 +37,7 @@
#define HPFS_SUPER_MAGIC 0xf995e849
#define ISOFS_SUPER_MAGIC 0x9660
#define JFFS2_SUPER_MAGIC 0x72b6
+#define JFS_SUPER_MAGIC 0x3153464a /* "JFS1" */
#define PSTOREFS_MAGIC 0x6165676C
#define EFIVARFS_MAGIC 0xde5e81e4
#define HFSPLUS_SUPER_MAGIC 0x482b
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 15/22] logfs: add LOGFS_FTYPE_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (13 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 14/22] jfs: move JFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 16/22] ntfs: move NTFS_SUPER_MAGIC " Karel Zak
` (7 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Joern Engel
Move the 32bit statfs f_type magic number to proper place.
CC: Joern Engel <joern@logfs.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/logfs/logfs_abi.h | 7 +++++--
fs/logfs/super.c | 2 +-
include/uapi/linux/magic.h | 2 ++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/logfs/logfs_abi.h b/fs/logfs/logfs_abi.h
index ae96051..afa7922 100644
--- a/fs/logfs/logfs_abi.h
+++ b/fs/logfs/logfs_abi.h
@@ -60,9 +60,12 @@ static inline void check_##type(void) \
*/
-/* Magic numbers. 64bit for superblock, 32bit for statfs f_type */
+/*
+ * Magic numbers.
+ *
+ * 64bit for superblock, 32bit for statfs f_type defined in linux/magic.h
+ */
#define LOGFS_MAGIC 0x7a3a8e5cb9d5bf67ull
-#define LOGFS_MAGIC_U32 0xc97e8168u
/*
* Various blocksize related macros. Blocksize is currently fixed at 4KiB.
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index 5436029..0b84753 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -99,7 +99,7 @@ int logfs_statfs(struct dentry *dentry, struct kstatfs *stats)
struct super_block *sb = dentry->d_sb;
struct logfs_super *super = logfs_super(sb);
- stats->f_type = LOGFS_MAGIC_U32;
+ stats->f_type = LOGFS_FTYPE_MAGIC;
stats->f_bsize = sb->s_blocksize;
stats->f_blocks = super->s_size >> LOGFS_BLOCK_BITS >> 3;
stats->f_bfree = super->s_free_bytes >> sb->s_blocksize_bits;
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 7898d5d..a102467 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -46,6 +46,8 @@
#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
+#define LOGFS_FTYPE_MAGIC 0xc97e8168
+
#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 16/22] ntfs: move NTFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (14 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 15/22] logfs: add LOGFS_FTYPE_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 17/22] ocfs2: move OCFS2_SUPER_MAGIC " Karel Zak
` (6 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Anton Altaparmakov
Move the magic number to proper place.
CC: Anton Altaparmakov <anton@tuxera.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/ntfs/ntfs.h | 2 +-
fs/ntfs/super.c | 4 ++--
include/uapi/linux/magic.h | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
index d6a340bf..4d2175a 100644
--- a/fs/ntfs/ntfs.h
+++ b/fs/ntfs/ntfs.h
@@ -32,6 +32,7 @@
#include <linux/nls.h>
#include <linux/smp.h>
#include <linux/pagemap.h>
+#include <linux/magic.h>
#include "types.h"
#include "volume.h"
@@ -40,7 +41,6 @@
typedef enum {
NTFS_BLOCK_SIZE = 512,
NTFS_BLOCK_SIZE_BITS = 9,
- NTFS_SB_MAGIC = 0x5346544e, /* 'NTFS' */
NTFS_MAX_NAME_LEN = 255,
NTFS_MAX_ATTR_NAME_LEN = 255,
NTFS_MAX_CLUSTER_SIZE = 64 * 1024, /* 64kiB */
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 82650d5..6b0931f 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -2620,7 +2620,7 @@ static int ntfs_statfs(struct dentry *dentry, struct kstatfs *sfs)
ntfs_debug("Entering.");
/* Type of filesystem. */
- sfs->f_type = NTFS_SB_MAGIC;
+ sfs->f_type = NTFS_SUPER_MAGIC;
/* Optimal transfer block size. */
sfs->f_bsize = PAGE_CACHE_SIZE;
/*
@@ -2847,7 +2847,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
/* Initialize the cluster and mft allocators. */
ntfs_setup_allocators(vol);
/* Setup remaining fields in the super block. */
- sb->s_magic = NTFS_SB_MAGIC;
+ sb->s_magic = NTFS_SUPER_MAGIC;
/*
* Ntfs allows 63 bits for the file size, i.e. correct would be:
* sb->s_maxbytes = ~0ULL >> 1;
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index a102467..974e47e 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -33,6 +33,7 @@
#define FUSE_SUPER_MAGIC 0x65735546
#define BTRFS_SUPER_MAGIC 0x9123683E
#define NILFS_SUPER_MAGIC 0x3434
+#define NTFS_SUPER_MAGIC 0x5346544e /* 'NTFS' */
#define F2FS_SUPER_MAGIC 0xF2F52010
#define HPFS_SUPER_MAGIC 0xf995e849
#define ISOFS_SUPER_MAGIC 0x9660
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 17/22] ocfs2: move OCFS2_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (15 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 16/22] ntfs: move NTFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 18/22] omfs: move OMFS_MAGIC " Karel Zak
` (5 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Mark Fasheh
Move the magic number to proper place.
CC: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/ocfs2/ocfs2_fs.h | 5 ++---
include/uapi/linux/magic.h | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 938387a..aee3897 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -25,6 +25,8 @@
#ifndef _OCFS2_FS_H
#define _OCFS2_FS_H
+#include <linux/magic.h>
+
/* Version */
#define OCFS2_MAJOR_REV_LEVEL 0
#define OCFS2_MINOR_REV_LEVEL 90
@@ -56,9 +58,6 @@
#define OCFS2_MIN_BLOCKSIZE 512
#define OCFS2_MAX_BLOCKSIZE OCFS2_MIN_CLUSTERSIZE
-/* Filesystem magic number */
-#define OCFS2_SUPER_MAGIC 0x7461636f
-
/* Object signatures */
#define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2"
#define OCFS2_INODE_SIGNATURE "INODE01"
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 974e47e..99c6548 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -15,6 +15,7 @@
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
#define DEBUGFS_MAGIC 0x64626720
#define GFS2_MAGIC 0x01161970
+#define OCFS2_SUPER_MAGIC 0x7461636f
#define MQUEUE_MAGIC 0x19800202
#define SECURITYFS_MAGIC 0x73636673
#define SELINUX_MAGIC 0xf97cff8c
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 18/22] omfs: move OMFS_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (16 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 17/22] ocfs2: move OCFS2_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 13:51 ` Bob Copeland
2014-03-04 10:00 ` [PATCH 19/22] romfs: move ROMFS_MAGIC " Karel Zak
` (4 subsequent siblings)
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Bob Copeland
Move the magic number to proper place.
CC: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/omfs/omfs_fs.h | 3 ++-
include/uapi/linux/magic.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/omfs/omfs_fs.h b/fs/omfs/omfs_fs.h
index ee5e432..889269e 100644
--- a/fs/omfs/omfs_fs.h
+++ b/fs/omfs/omfs_fs.h
@@ -1,9 +1,10 @@
#ifndef _OMFS_FS_H
#define _OMFS_FS_H
+#include <linux/magic.h>
+
/* OMFS On-disk structures */
-#define OMFS_MAGIC 0xC2993D87
#define OMFS_IMAGIC 0xD2
#define OMFS_DIR 'D'
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 99c6548..90b1681 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -16,6 +16,7 @@
#define DEBUGFS_MAGIC 0x64626720
#define GFS2_MAGIC 0x01161970
#define OCFS2_SUPER_MAGIC 0x7461636f
+#define OMFS_MAGIC 0xC2993D87
#define MQUEUE_MAGIC 0x19800202
#define SECURITYFS_MAGIC 0x73636673
#define SELINUX_MAGIC 0xf97cff8c
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 19/22] romfs: move ROMFS_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (17 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 18/22] omfs: move OMFS_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 20/22] ubifs: move UBIFS_SUPER_MAGIC " Karel Zak
` (3 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak
Move the magic number to proper place.
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/uapi/linux/magic.h | 1 +
include/uapi/linux/romfs_fs.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 90b1681..c8b2b7e 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -24,6 +24,7 @@
#define RAMFS_MAGIC 0x858458f6 /* some random number */
#define TMPFS_MAGIC 0x01021994
#define HUGETLBFS_MAGIC 0x958458f6 /* some random number */
+#define ROMFS_MAGIC 0x7275
#define SQUASHFS_MAGIC 0x73717368
#define ECRYPTFS_SUPER_MAGIC 0xf15f
#define EFS_SUPER_MAGIC 0x414A53
diff --git a/include/uapi/linux/romfs_fs.h b/include/uapi/linux/romfs_fs.h
index 5f57f93..cc77f59 100644
--- a/include/uapi/linux/romfs_fs.h
+++ b/include/uapi/linux/romfs_fs.h
@@ -3,13 +3,13 @@
#include <linux/types.h>
#include <linux/fs.h>
+#include <linux/magic.h>
/* The basic structures of the romfs filesystem */
#define ROMBSIZE BLOCK_SIZE
#define ROMBSBITS BLOCK_SIZE_BITS
#define ROMBMASK (ROMBSIZE-1)
-#define ROMFS_MAGIC 0x7275
#define ROMFS_MAXFN 128
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 20/22] ubifs: move UBIFS_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (18 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 19/22] romfs: move ROMFS_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:00 ` [PATCH 21/22] udf: move UDF_SUPER_MAGIC " Karel Zak
` (2 subsequent siblings)
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Artem Bityutskiy
Move the magic number to proper place.
CC: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/ubifs/ubifs.h | 4 +---
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index e8c8cfe..0dc0005 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -36,6 +36,7 @@
#include <linux/mtd/ubi.h>
#include <linux/pagemap.h>
#include <linux/backing-dev.h>
+#include <linux/magic.h>
#include "ubifs-media.h"
/* Version of this UBIFS implementation */
@@ -52,9 +53,6 @@
pr_warn("UBIFS warning (pid %d): %s: " fmt "\n", \
current->pid, __func__, ##__VA_ARGS__)
-/* UBIFS file system VFS magic number */
-#define UBIFS_SUPER_MAGIC 0x24051905
-
/* Number of UBIFS blocks per VFS page */
#define UBIFS_BLOCKS_PER_PAGE (PAGE_CACHE_SIZE / UBIFS_BLOCK_SIZE)
#define UBIFS_BLOCKS_PER_PAGE_SHIFT (PAGE_CACHE_SHIFT - UBIFS_BLOCK_SHIFT)
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index c8b2b7e..a042445 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -47,6 +47,7 @@
#define HFSPLUS_SUPER_MAGIC 0x482b
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
#define HPPFS_SUPER_MAGIC 0xb00000ee
+#define UBIFS_SUPER_MAGIC 0x24051905
#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 21/22] udf: move UDF_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (19 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 20/22] ubifs: move UBIFS_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 11:11 ` Jan Kara
2014-03-04 10:00 ` [PATCH 22/22] ufs: move UFS_MAGIC and UFS2_MAGIC " Karel Zak
2014-03-04 10:58 ` move all statfs f_type magic numbers to linux/magic.h Dave Chinner
22 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Jan Kara
Move the magic number to proper place.
CC: Jan Kara <jack@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/udf/udf_sb.h | 2 +-
include/uapi/linux/magic.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 1f32c7b..6316160 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -3,9 +3,9 @@
#include <linux/mutex.h>
#include <linux/bitops.h>
+#include <linux/magic.h>
/* Since UDF 2.01 is ISO 13346 based... */
-#define UDF_SUPER_MAGIC 0x15013346
#define UDF_MAX_READ_VERSION 0x0250
#define UDF_MAX_WRITE_VERSION 0x0201
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index a042445..aae1070 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -48,6 +48,7 @@
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
#define HPPFS_SUPER_MAGIC 0xb00000ee
#define UBIFS_SUPER_MAGIC 0x24051905
+#define UDF_SUPER_MAGIC 0x15013346
#define VXFS_SUPER_MAGIC 0xa501FCF5
#define XFS_SUPER_MAGIC 0x58465342
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 21/22] udf: move UDF_SUPER_MAGIC to <linux/magic.h>
2014-03-04 10:00 ` [PATCH 21/22] udf: move UDF_SUPER_MAGIC " Karel Zak
@ 2014-03-04 11:11 ` Jan Kara
2014-03-04 11:14 ` Jan Kara
0 siblings, 1 reply; 35+ messages in thread
From: Jan Kara @ 2014-03-04 11:11 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel, Jan Kara
On Tue 04-03-14 11:00:57, Karel Zak wrote:
> Move the magic number to proper place.
>
> CC: Jan Kara <jack@suse.cz>
> Signed-off-by: Karel Zak <kzak@redhat.com>
> ---
> fs/udf/udf_sb.h | 2 +-
> include/uapi/linux/magic.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> index 1f32c7b..6316160 100644
> --- a/fs/udf/udf_sb.h
> +++ b/fs/udf/udf_sb.h
> @@ -3,9 +3,9 @@
>
> #include <linux/mutex.h>
> #include <linux/bitops.h>
> +#include <linux/magic.h>
>
> /* Since UDF 2.01 is ISO 13346 based... */
> -#define UDF_SUPER_MAGIC 0x15013346
The comment refers to the magic so delete it as well... Otherwise the
patch looks OK.
Honza
>
> #define UDF_MAX_READ_VERSION 0x0250
> #define UDF_MAX_WRITE_VERSION 0x0201
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index a042445..aae1070 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -48,6 +48,7 @@
> #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> #define HPPFS_SUPER_MAGIC 0xb00000ee
> #define UBIFS_SUPER_MAGIC 0x24051905
> +#define UDF_SUPER_MAGIC 0x15013346
> #define VXFS_SUPER_MAGIC 0xa501FCF5
> #define XFS_SUPER_MAGIC 0x58465342
>
> --
> 1.8.5.3
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 21/22] udf: move UDF_SUPER_MAGIC to <linux/magic.h>
2014-03-04 11:11 ` Jan Kara
@ 2014-03-04 11:14 ` Jan Kara
0 siblings, 0 replies; 35+ messages in thread
From: Jan Kara @ 2014-03-04 11:14 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel, Jan Kara
On Tue 04-03-14 12:11:17, Jan Kara wrote:
> On Tue 04-03-14 11:00:57, Karel Zak wrote:
> > Move the magic number to proper place.
> >
> > CC: Jan Kara <jack@suse.cz>
> > Signed-off-by: Karel Zak <kzak@redhat.com>
> > ---
> > fs/udf/udf_sb.h | 2 +-
> > include/uapi/linux/magic.h | 1 +
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
> > index 1f32c7b..6316160 100644
> > --- a/fs/udf/udf_sb.h
> > +++ b/fs/udf/udf_sb.h
> > @@ -3,9 +3,9 @@
> >
> > #include <linux/mutex.h>
> > #include <linux/bitops.h>
> > +#include <linux/magic.h>
> >
> > /* Since UDF 2.01 is ISO 13346 based... */
> > -#define UDF_SUPER_MAGIC 0x15013346
> The comment refers to the magic so delete it as well... Otherwise the
> patch looks OK.
... meaning you can add
Acked-by: Jan Kara <jack@suse.cz>
I could take the patch if you prefer that but I guess you'll merge the whole
series at once, right?
Honza
> > #define UDF_MAX_READ_VERSION 0x0250
> > #define UDF_MAX_WRITE_VERSION 0x0201
> > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > index a042445..aae1070 100644
> > --- a/include/uapi/linux/magic.h
> > +++ b/include/uapi/linux/magic.h
> > @@ -48,6 +48,7 @@
> > #define HOSTFS_SUPER_MAGIC 0x00c0ffee
> > #define HPPFS_SUPER_MAGIC 0xb00000ee
> > #define UBIFS_SUPER_MAGIC 0x24051905
> > +#define UDF_SUPER_MAGIC 0x15013346
> > #define VXFS_SUPER_MAGIC 0xa501FCF5
> > #define XFS_SUPER_MAGIC 0x58465342
> >
> > --
> > 1.8.5.3
> >
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 22/22] ufs: move UFS_MAGIC and UFS2_MAGIC to <linux/magic.h>
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (20 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 21/22] udf: move UDF_SUPER_MAGIC " Karel Zak
@ 2014-03-04 10:00 ` Karel Zak
2014-03-04 10:58 ` move all statfs f_type magic numbers to linux/magic.h Dave Chinner
22 siblings, 0 replies; 35+ messages in thread
From: Karel Zak @ 2014-03-04 10:00 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, Karel Zak, Evgeniy Dushistov
Move the magic numbers to proper place.
CC: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fs/ufs/ufs_fs.h | 5 +++--
include/uapi/linux/magic.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/ufs/ufs_fs.h b/fs/ufs/ufs_fs.h
index 0cbd5d3..dba15d3 100644
--- a/fs/ufs/ufs_fs.h
+++ b/fs/ufs/ufs_fs.h
@@ -35,6 +35,7 @@
#include <linux/stat.h>
#include <linux/fs.h>
#include <linux/workqueue.h>
+#include <linux/magic.h>
#include <asm/div64.h>
typedef __u64 __bitwise __fs64;
@@ -48,9 +49,9 @@ typedef __u16 __bitwise __fs16;
#define UFS_SECTOR_SIZE 512
#define UFS_SECTOR_BITS 9
-#define UFS_MAGIC 0x00011954
+
+/* see linux/magic.h for regular magic numbers */
#define UFS_MAGIC_BW 0x0f242697
-#define UFS2_MAGIC 0x19540119
#define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */
/* Copied from FreeBSD */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index aae1070..5004e95 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -24,6 +24,8 @@
#define RAMFS_MAGIC 0x858458f6 /* some random number */
#define TMPFS_MAGIC 0x01021994
#define HUGETLBFS_MAGIC 0x958458f6 /* some random number */
+#define UFS_MAGIC 0x00011954
+#define UFS2_MAGIC 0x19540119
#define ROMFS_MAGIC 0x7275
#define SQUASHFS_MAGIC 0x73717368
#define ECRYPTFS_SUPER_MAGIC 0xf15f
--
1.8.5.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: move all statfs f_type magic numbers to linux/magic.h
2014-03-04 10:00 move all statfs f_type magic numbers to linux/magic.h Karel Zak
` (21 preceding siblings ...)
2014-03-04 10:00 ` [PATCH 22/22] ufs: move UFS_MAGIC and UFS2_MAGIC " Karel Zak
@ 2014-03-04 10:58 ` Dave Chinner
2014-03-04 12:37 ` Karel Zak
22 siblings, 1 reply; 35+ messages in thread
From: Dave Chinner @ 2014-03-04 10:58 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
On Tue, Mar 04, 2014 at 11:00:36AM +0100, Karel Zak wrote:
> The file <linux/magic.h> is incomplete and some magic numbers that kernel
> returns by statfs f_type to userspace are not defined there. This situation
> makes statfs f_type usage in userpace painful as you have to "ifndef-define"
> many magic numbers in userspace code.
>
> All the patches are trivial and just move *_SUPER_MAGIC stuff from
> filesystem specific files to the generic <linux/magic.h>.
IMO, this is the wrong way to fix the statfs magic numbers into the
user API. You're changing the code to define magic numbers that are
on disk to be defined - and fixed permanently - by the statfs
syscall API.
We need to be able to change the on-disk magic numbers whenever and
however we want without affecting userspace, but if you tie them
together then filesystems will break the ABI every time a new on
disk superblock magic number is required by a filesystem.
If you want all the magic numbers that filesystems expose to
userspace in statfs to be defined in one place, then you need to
create the definitions for only that purpose that match what is
currently documented in the statfs() man page and use those in the
filesystem statfs implementation rather than the on-disk superblock
magic number definitions.
e.g. include/uapi/linux/statfs_magic.h:
#define __STATFS_ADFS_SUPER_MAGIC 0xadf5
#define __STATFS_AFFS_SUPER_MAGIC 0xADFF
...
and then convert all the kernel filesystem statfs code to use these
types rather than their on-disk magic numbers in f_type.
Then, for userspace, wrap them appropriately in glibc sys/statfs.h:
#include <linux/statfs_magic.h>
#define ADFS_SUPER_MAGIC __STATFS_ADFS_SUPER_MAGIC
#define AFFS_SUPER_MAGIC __STATFS_AFFS_SUPER_MAGIC
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: move all statfs f_type magic numbers to linux/magic.h
2014-03-04 10:58 ` move all statfs f_type magic numbers to linux/magic.h Dave Chinner
@ 2014-03-04 12:37 ` Karel Zak
2014-03-05 0:20 ` Dave Chinner
0 siblings, 1 reply; 35+ messages in thread
From: Karel Zak @ 2014-03-04 12:37 UTC (permalink / raw)
To: Dave Chinner; +Cc: Al Viro, linux-fsdevel
On Tue, Mar 04, 2014 at 09:58:07PM +1100, Dave Chinner wrote:
> On Tue, Mar 04, 2014 at 11:00:36AM +0100, Karel Zak wrote:
> > The file <linux/magic.h> is incomplete and some magic numbers that kernel
> > returns by statfs f_type to userspace are not defined there. This situation
> > makes statfs f_type usage in userpace painful as you have to "ifndef-define"
> > many magic numbers in userspace code.
> >
> > All the patches are trivial and just move *_SUPER_MAGIC stuff from
> > filesystem specific files to the generic <linux/magic.h>.
>
> IMO, this is the wrong way to fix the statfs magic numbers into the
> user API. You're changing the code to define magic numbers that are
> on disk to be defined - and fixed permanently - by the statfs
> syscall API.
Well, my idea was to follow the current kernel manner :-) and add the
missing magic numbers to the API.
I agree that linux/magic.h is mess, and if there is call for something
better than I can send v2 with API cleanup.
> We need to be able to change the on-disk magic numbers whenever and
> however we want without affecting userspace
It's still possible, just define a new FOO_SUPER_MAGIC2 in fs code
and keep linux/magic.h unchanged.
And not in all cases *_SUPER_MAGIC are used for on-disk stuff, very
often it's magic number for s_magic and f_type only.
> If you want all the magic numbers that filesystems expose to
> userspace in statfs to be defined in one place, then you need to
> create the definitions for only that purpose that match what is
Yes, I thought about it, but I was not sure if such change will be
accepted.
> currently documented in the statfs() man page and use those in the
> filesystem statfs implementation rather than the on-disk superblock
> magic number definitions.
>
> e.g. include/uapi/linux/statfs_magic.h:
>
> #define __STATFS_ADFS_SUPER_MAGIC 0xadf5
> #define __STATFS_AFFS_SUPER_MAGIC 0xADFF
> ...
Now filesystems usually share statfs f_type with superblock s_magic.
It would be probably good enough to use something like
include/uapi/linux/statfs_magic.h:
#define __STATFS_FOO_SUPER_MAGIC 0xadf5
fs/foo/foo_sb.h:
#define FOO_SUPER_MAGIC __STATFS_FOO_SUPER_MAGIC
to avoid multiple definitions of the same numbers.
> and then convert all the kernel filesystem statfs code to use these
> types rather than their on-disk magic numbers in f_type.
>
> Then, for userspace, wrap them appropriately in glibc sys/statfs.h:
>
> #include <linux/statfs_magic.h>
>
> #define ADFS_SUPER_MAGIC __STATFS_ADFS_SUPER_MAGIC
> #define AFFS_SUPER_MAGIC __STATFS_AFFS_SUPER_MAGIC
and what about the old linux/magic.h? I guess it's necessary
to keep it for backward compatibility.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: move all statfs f_type magic numbers to linux/magic.h
2014-03-04 12:37 ` Karel Zak
@ 2014-03-05 0:20 ` Dave Chinner
0 siblings, 0 replies; 35+ messages in thread
From: Dave Chinner @ 2014-03-05 0:20 UTC (permalink / raw)
To: Karel Zak; +Cc: Al Viro, linux-fsdevel
On Tue, Mar 04, 2014 at 01:37:59PM +0100, Karel Zak wrote:
> On Tue, Mar 04, 2014 at 09:58:07PM +1100, Dave Chinner wrote:
> > On Tue, Mar 04, 2014 at 11:00:36AM +0100, Karel Zak wrote:
> > > The file <linux/magic.h> is incomplete and some magic numbers that kernel
> > > returns by statfs f_type to userspace are not defined there. This situation
> > > makes statfs f_type usage in userpace painful as you have to "ifndef-define"
> > > many magic numbers in userspace code.
> > >
> > > All the patches are trivial and just move *_SUPER_MAGIC stuff from
> > > filesystem specific files to the generic <linux/magic.h>.
> >
> > IMO, this is the wrong way to fix the statfs magic numbers into the
> > user API. You're changing the code to define magic numbers that are
> > on disk to be defined - and fixed permanently - by the statfs
> > syscall API.
>
> Well, my idea was to follow the current kernel manner :-) and add the
> missing magic numbers to the API.
>
> I agree that linux/magic.h is mess, and if there is call for something
> better than I can send v2 with API cleanup.
>
> > We need to be able to change the on-disk magic numbers whenever and
> > however we want without affecting userspace
>
> It's still possible, just define a new FOO_SUPER_MAGIC2 in fs code
> and keep linux/magic.h unchanged.
Which points out exactly why the coupling this patch set introduces
is wrong.
> And not in all cases *_SUPER_MAGIC are used for on-disk stuff, very
> often it's magic number for s_magic and f_type only.
Sure, those cases are fine. But it's not ok to move an on-disk
format definition into the userspace API.
> > If you want all the magic numbers that filesystems expose to
> > userspace in statfs to be defined in one place, then you need to
> > create the definitions for only that purpose that match what is
>
> Yes, I thought about it, but I was not sure if such change will be
> accepted.
>
> > currently documented in the statfs() man page and use those in the
> > filesystem statfs implementation rather than the on-disk superblock
> > magic number definitions.
> >
> > e.g. include/uapi/linux/statfs_magic.h:
> >
> > #define __STATFS_ADFS_SUPER_MAGIC 0xadf5
> > #define __STATFS_AFFS_SUPER_MAGIC 0xADFF
> > ...
>
> Now filesystems usually share statfs f_type with superblock s_magic.
> It would be probably good enough to use something like
>
> include/uapi/linux/statfs_magic.h:
>
> #define __STATFS_FOO_SUPER_MAGIC 0xadf5
>
> fs/foo/foo_sb.h:
>
> #define FOO_SUPER_MAGIC __STATFS_FOO_SUPER_MAGIC
>
> to avoid multiple definitions of the same numbers.
That has exactly the same problem as this patchset - you're
coupling the on-disk format definition to an unrelated userspace API
definition.
We shouldn't have a single shared definition of magic numbers for
statfs and on-disk formats. They are independent, have different
rules determining how they can be changed and have completely
different purposes in life. Hence they should be defined separately,
even if they are initially defined to the same value....
> and what about the old linux/magic.h? I guess it's necessary
> to keep it for backward compatibility.
It's part of the UAPI - it has to remain there forever now....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 35+ messages in thread