diff options
author | Nick Black <dank@qemfd.net> | 2009-09-22 19:43:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:28 -0400 |
commit | 1fd7317d02ec03c6fdf072317841287933d06d24 (patch) | |
tree | b7ac4d511896dbb21c1b76a27f6c4d5b4cb6c7bb | |
parent | af91322ef3f29ae4114e736e2a72e28b4d619cf9 (diff) |
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>
-rw-r--r-- | fs/devpts/inode.c | 3 | ||||
-rw-r--r-- | fs/hugetlbfs/inode.c | 4 | ||||
-rw-r--r-- | include/linux/magic.h | 5 | ||||
-rw-r--r-- | net/socket.c | 3 | ||||
-rw-r--r-- | security/smack/smack_lsm.c | 8 |
5 files changed, 9 insertions, 14 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 75efb028974..d5f8c96964b 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
@@ -18,14 +18,13 @@ | |||
18 | #include <linux/mount.h> | 18 | #include <linux/mount.h> |
19 | #include <linux/tty.h> | 19 | #include <linux/tty.h> |
20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
21 | #include <linux/magic.h> | ||
21 | #include <linux/idr.h> | 22 | #include <linux/idr.h> |
22 | #include <linux/devpts_fs.h> | 23 | #include <linux/devpts_fs.h> |
23 | #include <linux/parser.h> | 24 | #include <linux/parser.h> |
24 | #include <linux/fsnotify.h> | 25 | #include <linux/fsnotify.h> |
25 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
26 | 27 | ||
27 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | ||
28 | |||
29 | #define DEVPTS_DEFAULT_MODE 0600 | 28 | #define DEVPTS_DEFAULT_MODE 0600 |
30 | /* | 29 | /* |
31 | * ptmx is a new node in /dev/pts and will be unused in legacy (single- | 30 | * ptmx is a new node in /dev/pts and will be unused in legacy (single- |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 06b7c2623f9..eba6d552d9c 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -31,12 +31,10 @@ | |||
31 | #include <linux/statfs.h> | 31 | #include <linux/statfs.h> |
32 | #include <linux/security.h> | 32 | #include <linux/security.h> |
33 | #include <linux/ima.h> | 33 | #include <linux/ima.h> |
34 | #include <linux/magic.h> | ||
34 | 35 | ||
35 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
36 | 37 | ||
37 | /* some random number */ | ||
38 | #define HUGETLBFS_MAGIC 0x958458f6 | ||
39 | |||
40 | static const struct super_operations hugetlbfs_ops; | 38 | static const struct super_operations hugetlbfs_ops; |
41 | static const struct address_space_operations hugetlbfs_aops; | 39 | static const struct address_space_operations hugetlbfs_aops; |
42 | const struct file_operations hugetlbfs_file_operations; | 40 | const struct file_operations hugetlbfs_file_operations; |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1923327b986..bce37786a0a 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define SECURITYFS_MAGIC 0x73636673 | 13 | #define SECURITYFS_MAGIC 0x73636673 |
14 | #define SELINUX_MAGIC 0xf97cff8c | 14 | #define SELINUX_MAGIC 0xf97cff8c |
15 | #define TMPFS_MAGIC 0x01021994 | 15 | #define TMPFS_MAGIC 0x01021994 |
16 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | ||
16 | #define SQUASHFS_MAGIC 0x73717368 | 17 | #define SQUASHFS_MAGIC 0x73717368 |
17 | #define EFS_SUPER_MAGIC 0x414A53 | 18 | #define EFS_SUPER_MAGIC 0x414A53 |
18 | #define EXT2_SUPER_MAGIC 0xEF53 | 19 | #define EXT2_SUPER_MAGIC 0xEF53 |
@@ -53,4 +54,8 @@ | |||
53 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | 54 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA |
54 | 55 | ||
55 | #define STACK_END_MAGIC 0x57AC6E9D | 56 | #define STACK_END_MAGIC 0x57AC6E9D |
57 | |||
58 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | ||
59 | #define SOCKFS_MAGIC 0x534F434B | ||
60 | |||
56 | #endif /* __LINUX_MAGIC_H__ */ | 61 | #endif /* __LINUX_MAGIC_H__ */ |
diff --git a/net/socket.c b/net/socket.c index 0ad02ae61a9..49917a1cac7 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -86,6 +86,7 @@ | |||
86 | #include <linux/audit.h> | 86 | #include <linux/audit.h> |
87 | #include <linux/wireless.h> | 87 | #include <linux/wireless.h> |
88 | #include <linux/nsproxy.h> | 88 | #include <linux/nsproxy.h> |
89 | #include <linux/magic.h> | ||
89 | 90 | ||
90 | #include <asm/uaccess.h> | 91 | #include <asm/uaccess.h> |
91 | #include <asm/unistd.h> | 92 | #include <asm/unistd.h> |
@@ -235,8 +236,6 @@ int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, | |||
235 | return __put_user(klen, ulen); | 236 | return __put_user(klen, ulen); |
236 | } | 237 | } |
237 | 238 | ||
238 | #define SOCKFS_MAGIC 0x534F434B | ||
239 | |||
240 | static struct kmem_cache *sock_inode_cachep __read_mostly; | 239 | static struct kmem_cache *sock_inode_cachep __read_mostly; |
241 | 240 | ||
242 | static struct inode *sock_alloc_inode(struct super_block *sb) | 241 | static struct inode *sock_alloc_inode(struct super_block *sb) |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index acae7ef4092..c33b6bb9b6d 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -30,17 +30,11 @@ | |||
30 | #include <net/netlabel.h> | 30 | #include <net/netlabel.h> |
31 | #include <net/cipso_ipv4.h> | 31 | #include <net/cipso_ipv4.h> |
32 | #include <linux/audit.h> | 32 | #include <linux/audit.h> |
33 | #include <linux/magic.h> | ||
33 | #include "smack.h" | 34 | #include "smack.h" |
34 | 35 | ||
35 | #define task_security(task) (task_cred_xxx((task), security)) | 36 | #define task_security(task) (task_cred_xxx((task), security)) |
36 | 37 | ||
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 | |||
44 | /** | 38 | /** |
45 | * smk_fetch - Fetch the smack label from a file. | 39 | * smk_fetch - Fetch the smack label from a file. |
46 | * @ip: a pointer to the inode | 40 | * @ip: a pointer to the inode |