janitorial/manpages: kill off duplication of constants
Subsystems (4)
PATCH 1/1 janitorial/manpages: kill off duplication of constants
Seize back constants duplicated in smack_lsm.c, exporting them via linux/magic.h. The removals expose no new interfaces, but moving SOCKFD_MAGIC and DEVPTS_SUPER_MAGIC to magic.h does expose to userspace what had not been previously exposed; I'm not sure this is desirable. If it is, the statfs(2) man page ought probably be updated to reflect the change. If not, #ifdef __KERNEL__ wrappers would work, but that might not be the best choice.
Either way, the statfs(2) page references a DEVFS_SUPER_MAGIC [shudder], which was, if memory serves, unceremoniously purged some time ago? There's no instance of DEVFS_SUPER_MAGIC in 2.6.31-rc1. I'd be happy to send man page patches in if that's desirable.
This is against 2.6.31-rc1. Thanks for feedback, Pekka Enberg!
--rigorously, nick
fs/devpts/inode.c +1 -2
@@ -18,14 +18,13 @@#include <linux/mount.h> #include <linux/tty.h> #include <linux/mutex.h> +#include <linux/magic.h> #include <linux/idr.h> #include <linux/devpts_fs.h> #include <linux/parser.h> #include <linux/fsnotify.h> #include <linux/seq_file.h> -#define DEVPTS_SUPER_MAGIC 0x1cd1 -#define DEVPTS_DEFAULT_MODE 0600/* * ptmx is a new node in /dev/pts and will be unused in legacy (single-
include/linux/magic.h +4 -0
@@ -53,4 +54,8 @@#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA#define STACK_END_MAGIC 0x57AC6E9D + +#define DEVPTS_SUPER_MAGIC 0x1cd1 +#define SOCKFS_MAGIC 0x534F434B +#endif /* __LINUX_MAGIC_H__ */
net/socket.c +1 -2
@@ -86,6 +86,7 @@#include <linux/audit.h> #include <linux/wireless.h> #include <linux/nsproxy.h> +#include <linux/magic.h> #include <asm/uaccess.h> #include <asm/unistd.h>
@@ -235,8 +236,6 @@ int move_addr_to_user(struct sockaddr *kreturn __put_user (klen, ulen); } -#define SOCKFS_MAGIC 0x534F434B -static struct kmem_cache *sock_inode_cachep__read_mostly ;static struct inode *sock_alloc_inode (struct super_block *sb)
security/smack/smack_lsm.c +1 -7
@@ -30,17 +30,11 @@#include <net/netlabel.h> #include <net/cipso_ipv4.h> #include <linux/audit.h> +#include <linux/magic.h> #include "smack.h" #define task_security (task) (task_cred_xxx((task), security)) -/* -* I hope these are the hokeyist lines of code in the module. Casey. -*/ -#define DEVPTS_SUPER_MAGIC 0x1cd1 -#define SOCKFS_MAGIC 0x534F434B -#define TMPFS_MAGIC 0x01021994 -/** * smk_fetch - Fetch the smack label from a file. * @ip: a pointer to the inode
Signature · 4 lines
Nick Black <[email protected]> Principal Engineer, McAfee Grad student, GT College of Computing "np: the class of dashed hopes, and idle dreams..."