Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Move magic numbers into magic.h

Move various magic-number definitions into magic.h.

Signed-off-by: Nick Black <dank@qemfd.net>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Nick Black and committed by
Linus Torvalds
1fd7317d af91322e

+9 -14
+1 -2
fs/devpts/inode.c
··· 18 18 #include <linux/mount.h> 19 19 #include <linux/tty.h> 20 20 #include <linux/mutex.h> 21 + #include <linux/magic.h> 21 22 #include <linux/idr.h> 22 23 #include <linux/devpts_fs.h> 23 24 #include <linux/parser.h> 24 25 #include <linux/fsnotify.h> 25 26 #include <linux/seq_file.h> 26 - 27 - #define DEVPTS_SUPER_MAGIC 0x1cd1 28 27 29 28 #define DEVPTS_DEFAULT_MODE 0600 30 29 /*
+1 -3
fs/hugetlbfs/inode.c
··· 31 31 #include <linux/statfs.h> 32 32 #include <linux/security.h> 33 33 #include <linux/ima.h> 34 + #include <linux/magic.h> 34 35 35 36 #include <asm/uaccess.h> 36 - 37 - /* some random number */ 38 - #define HUGETLBFS_MAGIC 0x958458f6 39 37 40 38 static const struct super_operations hugetlbfs_ops; 41 39 static const struct address_space_operations hugetlbfs_aops;
+5
include/linux/magic.h
··· 13 13 #define SECURITYFS_MAGIC 0x73636673 14 14 #define SELINUX_MAGIC 0xf97cff8c 15 15 #define TMPFS_MAGIC 0x01021994 16 + #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ 16 17 #define SQUASHFS_MAGIC 0x73717368 17 18 #define EFS_SUPER_MAGIC 0x414A53 18 19 #define EXT2_SUPER_MAGIC 0xEF53 ··· 54 53 #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA 55 54 56 55 #define STACK_END_MAGIC 0x57AC6E9D 56 + 57 + #define DEVPTS_SUPER_MAGIC 0x1cd1 58 + #define SOCKFS_MAGIC 0x534F434B 59 + 57 60 #endif /* __LINUX_MAGIC_H__ */
+1 -2
net/socket.c
··· 86 86 #include <linux/audit.h> 87 87 #include <linux/wireless.h> 88 88 #include <linux/nsproxy.h> 89 + #include <linux/magic.h> 89 90 90 91 #include <asm/uaccess.h> 91 92 #include <asm/unistd.h> ··· 235 234 */ 236 235 return __put_user(klen, ulen); 237 236 } 238 - 239 - #define SOCKFS_MAGIC 0x534F434B 240 237 241 238 static struct kmem_cache *sock_inode_cachep __read_mostly; 242 239
+1 -7
security/smack/smack_lsm.c
··· 30 30 #include <net/netlabel.h> 31 31 #include <net/cipso_ipv4.h> 32 32 #include <linux/audit.h> 33 + #include <linux/magic.h> 33 34 #include "smack.h" 34 35 35 36 #define task_security(task) (task_cred_xxx((task), security)) 36 - 37 - /* 38 - * I hope these are the hokeyist lines of code in the module. Casey. 39 - */ 40 - #define DEVPTS_SUPER_MAGIC 0x1cd1 41 - #define SOCKFS_MAGIC 0x534F434B 42 - #define TMPFS_MAGIC 0x01021994 43 37 44 38 /** 45 39 * smk_fetch - Fetch the smack label from a file.