public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: nick black <dank@qemfd.net>
To: linux-kernel@vger.kernel.org
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	man-pages <mtk.manpages@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] janitorial/manpages: kill off duplication of constants
Date: Mon, 29 Jun 2009 09:33:26 -0400	[thread overview]
Message-ID: <20090629133326.GA3149@qemfd.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 4044 bytes --]

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

Signed-off-by: Nick Black <dank@qemfd.net>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/fs/devpts/inode.c linux-2.6.31-rc1/fs/devpts/inode.c
--- linux-2.6.31-rc1-pristine/fs/devpts/inode.c	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/fs/devpts/inode.c	2009-06-29 08:56:14.000000000 -0400
@@ -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-
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/include/linux/magic.h linux-2.6.31-rc1/include/linux/magic.h
--- linux-2.6.31-rc1-pristine/include/linux/magic.h	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/include/linux/magic.h	2009-06-29 08:55:57.000000000 -0400
@@ -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__ */
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/net/socket.c linux-2.6.31-rc1/net/socket.c
--- linux-2.6.31-rc1-pristine/net/socket.c	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/net/socket.c	2009-06-29 08:55:49.000000000 -0400
@@ -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 *k
 	return __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)
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/security/smack/smack_lsm.c linux-2.6.31-rc1/security/smack/smack_lsm.c
--- linux-2.6.31-rc1-pristine/security/smack/smack_lsm.c	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/security/smack/smack_lsm.c	2009-06-29 08:54:50.000000000 -0400
@@ -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

-- 
                                      Nick Black <dankamongmen@acm.org>
                                             Principal Engineer, McAfee
                                  Grad student, GT College of Computing
                    "np: the class of dashed hopes, and idle dreams..."

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

                 reply	other threads:[~2009-06-29 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090629133326.GA3149@qemfd.net \
    --to=dank@qemfd.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox