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

magic.h: move some FS magic numbers into magic.h

- Move open-coded filesystem magic numbers into magic.h

- Rearrange magic.h so that the filesystem-related constants are grouped
together.

Signed-off-by: Muthukumar R <muthur@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Muthu Kumar and committed by
Linus Torvalds
b502bd11 d982d595

+19 -12
+1 -1
drivers/mtd/mtdchar.c
··· 31 31 #include <linux/compat.h> 32 32 #include <linux/mount.h> 33 33 #include <linux/blkpg.h> 34 + #include <linux/magic.h> 34 35 #include <linux/mtd/mtd.h> 35 36 #include <linux/mtd/partitions.h> 36 37 #include <linux/mtd/map.h> 37 38 38 39 #include <asm/uaccess.h> 39 40 40 - #define MTD_INODE_FS_MAGIC 0x11307854 41 41 static DEFINE_MUTEX(mtd_mutex); 42 42 static struct vfsmount *mtd_inode_mnt __read_mostly; 43 43
+2 -1
fs/binfmt_misc.c
··· 19 19 #include <linux/module.h> 20 20 #include <linux/init.h> 21 21 #include <linux/sched.h> 22 + #include <linux/magic.h> 22 23 #include <linux/binfmts.h> 23 24 #include <linux/slab.h> 24 25 #include <linux/ctype.h> ··· 700 699 [3] = {"register", &bm_register_operations, S_IWUSR}, 701 700 /* last one */ {""} 702 701 }; 703 - int err = simple_fill_super(sb, 0x42494e4d, bm_files); 702 + int err = simple_fill_super(sb, BINFMTFS_MAGIC, bm_files); 704 703 if (!err) 705 704 sb->s_op = &s_ops; 706 705 return err;
+2 -1
fs/block_dev.c
··· 16 16 #include <linux/blkdev.h> 17 17 #include <linux/module.h> 18 18 #include <linux/blkpg.h> 19 + #include <linux/magic.h> 19 20 #include <linux/buffer_head.h> 20 21 #include <linux/swap.h> 21 22 #include <linux/pagevec.h> ··· 507 506 static struct dentry *bd_mount(struct file_system_type *fs_type, 508 507 int flags, const char *dev_name, void *data) 509 508 { 510 - return mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, 0x62646576); 509 + return mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC); 511 510 } 512 511 513 512 static struct file_system_type bd_type = {
+1
fs/pipe.c
··· 13 13 #include <linux/fs.h> 14 14 #include <linux/log2.h> 15 15 #include <linux/mount.h> 16 + #include <linux/magic.h> 16 17 #include <linux/pipe_fs_i.h> 17 18 #include <linux/uio.h> 18 19 #include <linux/highmem.h>
+13 -7
include/linux/magic.h
··· 9 9 #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ 10 10 #define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */ 11 11 #define DEBUGFS_MAGIC 0x64626720 12 - #define SYSFS_MAGIC 0x62656572 13 12 #define SECURITYFS_MAGIC 0x73636673 14 13 #define SELINUX_MAGIC 0xf97cff8c 15 14 #define RAMFS_MAGIC 0x858458f6 /* some random number */ ··· 26 27 #define HPFS_SUPER_MAGIC 0xf995e849 27 28 #define ISOFS_SUPER_MAGIC 0x9660 28 29 #define JFFS2_SUPER_MAGIC 0x72b6 29 - #define ANON_INODE_FS_MAGIC 0x09041934 30 30 #define PSTOREFS_MAGIC 0x6165676C 31 31 32 32 #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ ··· 38 40 #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ 39 41 #define NFS_SUPER_MAGIC 0x6969 40 42 #define OPENPROM_SUPER_MAGIC 0x9fa1 41 - #define PROC_SUPER_MAGIC 0x9fa0 42 43 #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ 43 44 #define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */ 44 45 ··· 49 52 #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" 50 53 51 54 #define SMB_SUPER_MAGIC 0x517B 52 - #define USBDEVICE_SUPER_MAGIC 0x9fa2 53 55 #define CGROUP_SUPER_MAGIC 0x27e0eb 54 56 55 - #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA 56 57 57 58 #define STACK_END_MAGIC 0x57AC6E9D 58 59 59 - #define DEVPTS_SUPER_MAGIC 0x1cd1 60 - #define SOCKFS_MAGIC 0x534F434B 61 60 #define V9FS_MAGIC 0x01021997 61 + 62 + #define BDEVFS_MAGIC 0x62646576 63 + #define BINFMTFS_MAGIC 0x42494e4d 64 + #define DEVPTS_SUPER_MAGIC 0x1cd1 65 + #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA 66 + #define PIPEFS_MAGIC 0x50495045 67 + #define PROC_SUPER_MAGIC 0x9fa0 68 + #define SOCKFS_MAGIC 0x534F434B 69 + #define SYSFS_MAGIC 0x62656572 70 + #define USBDEVICE_SUPER_MAGIC 0x9fa2 71 + #define MTD_INODE_FS_MAGIC 0x11307854 72 + #define ANON_INODE_FS_MAGIC 0x09041934 73 + 62 74 63 75 #endif /* __LINUX_MAGIC_H__ */
-2
include/linux/pipe_fs_i.h
··· 1 1 #ifndef _LINUX_PIPE_FS_I_H 2 2 #define _LINUX_PIPE_FS_I_H 3 3 4 - #define PIPEFS_MAGIC 0x50495045 5 - 6 4 #define PIPE_DEF_BUFFERS 16 7 5 8 6 #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */