linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Make xattr_handler constant patches
@ 2010-05-14  0:53 Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 01/10] fs: xattr_handler table should be const Stephen Hemminger
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

I noticed that all the other filesystem virtual function
tables are already constant, except extended attribute handler.
This patch series converts all the entries in the current tree

Ext* filesystems actually tested. Others are compile 
tested only.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 01/10] fs: xattr_handler table should be const
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 02/10] btrfs: constify xattr_handler Stephen Hemminger
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: xattr-handler-const.patch --]
[-- Type: text/plain, Size: 5174 bytes --]

The entries in xattr handler table should be immutable (ie const)
like other operation tables.

Later patches convert common filesystems. Uncoverted filesystems
will still work, but will generate a compiler warning.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 fs/generic_acl.c            |    4 ++--
 fs/xattr.c                  |   14 +++++++-------
 include/linux/fs.h          |    2 +-
 include/linux/generic_acl.h |    4 ++--
 include/linux/xattr.h       |    2 +-
 mm/shmem.c                  |    4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

--- a/include/linux/xattr.h	2010-05-13 16:34:05.403477486 -0700
+++ b/include/linux/xattr.h	2010-05-13 16:34:14.452532499 -0700
@@ -37,7 +37,7 @@ struct inode;
 struct dentry;
 
 struct xattr_handler {
-	char *prefix;
+	const char *prefix;
 	int flags;	/* fs private flags passed back to the handlers */
 	size_t (*list)(struct dentry *dentry, char *list, size_t list_size,
 		       const char *name, size_t name_len, int handler_flags);
--- a/include/linux/fs.h	2010-05-13 16:44:51.284126558 -0700
+++ b/include/linux/fs.h	2010-05-13 16:45:08.952534280 -0700
@@ -1339,7 +1339,7 @@ struct super_block {
 #ifdef CONFIG_SECURITY
 	void                    *s_security;
 #endif
-	struct xattr_handler	**s_xattr;
+	const struct xattr_handler **s_xattr;
 
 	struct list_head	s_inodes;	/* all inodes */
 	struct hlist_head	s_anon;		/* anonymous dentries for (nfs) exporting */
--- a/fs/generic_acl.c	2010-05-13 16:54:53.934439088 -0700
+++ b/fs/generic_acl.c	2010-05-13 16:55:13.842844638 -0700
@@ -201,7 +201,7 @@ generic_check_acl(struct inode *inode, i
 	return -EAGAIN;
 }
 
-struct xattr_handler generic_acl_access_handler = {
+const struct xattr_handler generic_acl_access_handler = {
 	.prefix = POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.list	= generic_acl_list,
@@ -209,7 +209,7 @@ struct xattr_handler generic_acl_access_
 	.set	= generic_acl_set,
 };
 
-struct xattr_handler generic_acl_default_handler = {
+const struct xattr_handler generic_acl_default_handler = {
 	.prefix = POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= generic_acl_list,
--- a/include/linux/generic_acl.h	2010-05-13 16:55:34.073187417 -0700
+++ b/include/linux/generic_acl.h	2010-05-13 16:55:41.652531852 -0700
@@ -5,8 +5,8 @@
 
 struct inode;
 
-extern struct xattr_handler generic_acl_access_handler;
-extern struct xattr_handler generic_acl_default_handler;
+extern const struct xattr_handler generic_acl_access_handler;
+extern const struct xattr_handler generic_acl_default_handler;
 
 int generic_acl_init(struct inode *, struct inode *);
 int generic_acl_chmod(struct inode *);
--- a/mm/shmem.c	2010-05-13 16:56:02.543789782 -0700
+++ b/mm/shmem.c	2010-05-13 16:56:23.162842856 -0700
@@ -2071,14 +2071,14 @@ static int shmem_xattr_security_set(stru
 					  size, flags);
 }
 
-static struct xattr_handler shmem_xattr_security_handler = {
+static const struct xattr_handler shmem_xattr_security_handler = {
 	.prefix = XATTR_SECURITY_PREFIX,
 	.list   = shmem_xattr_security_list,
 	.get    = shmem_xattr_security_get,
 	.set    = shmem_xattr_security_set,
 };
 
-static struct xattr_handler *shmem_xattr_handlers[] = {
+static const struct xattr_handler *shmem_xattr_handlers[] = {
 	&generic_acl_access_handler,
 	&generic_acl_default_handler,
 	&shmem_xattr_security_handler,
--- a/fs/xattr.c	2010-05-13 17:05:50.124699014 -0700
+++ b/fs/xattr.c	2010-05-13 17:09:58.074182182 -0700
@@ -590,10 +590,10 @@ strcmp_prefix(const char *a, const char 
 /*
  * Find the xattr_handler with the matching prefix.
  */
-static struct xattr_handler *
-xattr_resolve_name(struct xattr_handler **handlers, const char **name)
+static const struct xattr_handler *
+xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	if (!*name)
 		return NULL;
@@ -614,7 +614,7 @@ xattr_resolve_name(struct xattr_handler 
 ssize_t
 generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name);
 	if (!handler)
@@ -629,7 +629,7 @@ generic_getxattr(struct dentry *dentry, 
 ssize_t
 generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
 {
-	struct xattr_handler *handler, **handlers = dentry->d_sb->s_xattr;
+	const struct xattr_handler *handler, **handlers = dentry->d_sb->s_xattr;
 	unsigned int size = 0;
 
 	if (!buffer) {
@@ -659,7 +659,7 @@ generic_listxattr(struct dentry *dentry,
 int
 generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	if (size == 0)
 		value = "";  /* empty EA, do not remove */
@@ -676,7 +676,7 @@ generic_setxattr(struct dentry *dentry, 
 int
 generic_removexattr(struct dentry *dentry, const char *name)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name);
 	if (!handler)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 02/10] btrfs: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 01/10] fs: xattr_handler table should be const Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 03/10] ext2: " Stephen Hemminger
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: btrfs-xattr-const.patch --]
[-- Type: text/plain, Size: 1837 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/fs/btrfs/acl.c	2010-05-13 16:49:06.552512720 -0700
+++ b/fs/btrfs/acl.c	2010-05-13 16:49:33.092876752 -0700
@@ -282,14 +282,14 @@ int btrfs_acl_chmod(struct inode *inode)
 	return ret;
 }
 
-struct xattr_handler btrfs_xattr_acl_default_handler = {
+const struct xattr_handler btrfs_xattr_acl_default_handler = {
 	.prefix = POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.get	= btrfs_xattr_acl_get,
 	.set	= btrfs_xattr_acl_set,
 };
 
-struct xattr_handler btrfs_xattr_acl_access_handler = {
+const struct xattr_handler btrfs_xattr_acl_access_handler = {
 	.prefix = POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.get	= btrfs_xattr_acl_get,
--- a/fs/btrfs/xattr.c	2010-05-13 16:49:06.662512773 -0700
+++ b/fs/btrfs/xattr.c	2010-05-13 16:49:55.582824597 -0700
@@ -282,7 +282,7 @@ err:
  * List of handlers for synthetic system.* attributes.  All real ondisk
  * attributes are handled directly.
  */
-struct xattr_handler *btrfs_xattr_handlers[] = {
+const struct xattr_handler *btrfs_xattr_handlers[] = {
 #ifdef CONFIG_BTRFS_FS_POSIX_ACL
 	&btrfs_xattr_acl_access_handler,
 	&btrfs_xattr_acl_default_handler,
--- a/fs/btrfs/xattr.h	2010-05-13 16:49:06.762513075 -0700
+++ b/fs/btrfs/xattr.h	2010-05-13 16:50:47.473761894 -0700
@@ -21,9 +21,9 @@
 
 #include <linux/xattr.h>
 
-extern struct xattr_handler btrfs_xattr_acl_access_handler;
-extern struct xattr_handler btrfs_xattr_acl_default_handler;
-extern struct xattr_handler *btrfs_xattr_handlers[];
+extern const struct xattr_handler btrfs_xattr_acl_access_handler;
+extern const struct xattr_handler btrfs_xattr_acl_default_handler;
+extern const struct xattr_handler *btrfs_xattr_handlers[];
 
 extern ssize_t __btrfs_getxattr(struct inode *inode, const char *name,
 		void *buffer, size_t size);



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 03/10] ext2: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 01/10] fs: xattr_handler table should be const Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 02/10] btrfs: constify xattr_handler Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 04/10] Subject ext3: constify xattr handlers Stephen Hemminger
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: ext2-const-xattr.patch --]
[-- Type: text/plain, Size: 5045 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 fs/ext2/acl.c            |    4 ++--
 fs/ext2/xattr.c          |   10 +++++-----
 fs/ext2/xattr.h          |   12 ++++++------
 fs/ext2/xattr_security.c |    2 +-
 fs/ext2/xattr_trusted.c  |    2 +-
 fs/ext2/xattr_user.c     |    2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)

--- a/fs/ext2/acl.c	2010-05-13 17:05:23.333761348 -0700
+++ b/fs/ext2/acl.c	2010-05-13 17:10:27.694748597 -0700
@@ -420,7 +420,7 @@ release_and_out:
 	return error;
 }
 
-struct xattr_handler ext2_xattr_acl_access_handler = {
+const struct xattr_handler ext2_xattr_acl_access_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.list	= ext2_xattr_list_acl_access,
@@ -428,7 +428,7 @@ struct xattr_handler ext2_xattr_acl_acce
 	.set	= ext2_xattr_set_acl,
 };
 
-struct xattr_handler ext2_xattr_acl_default_handler = {
+const struct xattr_handler ext2_xattr_acl_default_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= ext2_xattr_list_acl_default,
--- a/fs/ext2/xattr.c	2010-05-13 17:05:23.353761435 -0700
+++ b/fs/ext2/xattr.c	2010-05-13 17:10:27.694748597 -0700
@@ -101,7 +101,7 @@ static void ext2_xattr_rehash(struct ext
 
 static struct mb_cache *ext2_xattr_cache;
 
-static struct xattr_handler *ext2_xattr_handler_map[] = {
+static const struct xattr_handler *ext2_xattr_handler_map[] = {
 	[EXT2_XATTR_INDEX_USER]		     = &ext2_xattr_user_handler,
 #ifdef CONFIG_EXT2_FS_POSIX_ACL
 	[EXT2_XATTR_INDEX_POSIX_ACL_ACCESS]  = &ext2_xattr_acl_access_handler,
@@ -113,7 +113,7 @@ static struct xattr_handler *ext2_xattr_
 #endif
 };
 
-struct xattr_handler *ext2_xattr_handlers[] = {
+const struct xattr_handler *ext2_xattr_handlers[] = {
 	&ext2_xattr_user_handler,
 	&ext2_xattr_trusted_handler,
 #ifdef CONFIG_EXT2_FS_POSIX_ACL
@@ -126,10 +126,10 @@ struct xattr_handler *ext2_xattr_handler
 	NULL
 };
 
-static inline struct xattr_handler *
+static inline const struct xattr_handler *
 ext2_xattr_handler(int name_index)
 {
-	struct xattr_handler *handler = NULL;
+	const struct xattr_handler *handler = NULL;
 
 	if (name_index > 0 && name_index < ARRAY_SIZE(ext2_xattr_handler_map))
 		handler = ext2_xattr_handler_map[name_index];
@@ -298,7 +298,7 @@ bad_block:	ext2_error(inode->i_sb, "ext2
 	/* list the attribute names */
 	for (entry = FIRST_ENTRY(bh); !IS_LAST_ENTRY(entry);
 	     entry = EXT2_XATTR_NEXT(entry)) {
-		struct xattr_handler *handler =
+		const struct xattr_handler *handler =
 			ext2_xattr_handler(entry->e_name_index);
 
 		if (handler) {
--- a/fs/ext2/xattr.h	2010-05-13 17:05:23.363784032 -0700
+++ b/fs/ext2/xattr.h	2010-05-13 17:12:00.023452295 -0700
@@ -55,11 +55,11 @@ struct ext2_xattr_entry {
 
 # ifdef CONFIG_EXT2_FS_XATTR
 
-extern struct xattr_handler ext2_xattr_user_handler;
-extern struct xattr_handler ext2_xattr_trusted_handler;
-extern struct xattr_handler ext2_xattr_acl_access_handler;
-extern struct xattr_handler ext2_xattr_acl_default_handler;
-extern struct xattr_handler ext2_xattr_security_handler;
+extern const struct xattr_handler ext2_xattr_user_handler;
+extern const struct xattr_handler ext2_xattr_trusted_handler;
+extern const struct xattr_handler ext2_xattr_acl_access_handler;
+extern const struct xattr_handler ext2_xattr_acl_default_handler;
+extern const struct xattr_handler ext2_xattr_security_handler;
 
 extern ssize_t ext2_listxattr(struct dentry *, char *, size_t);
 
@@ -72,7 +72,7 @@ extern void ext2_xattr_put_super(struct 
 extern int init_ext2_xattr(void);
 extern void exit_ext2_xattr(void);
 
-extern struct xattr_handler *ext2_xattr_handlers[];
+extern const struct xattr_handler *ext2_xattr_handlers[];
 
 # else  /* CONFIG_EXT2_FS_XATTR */
 
--- a/fs/ext2/xattr_security.c	2010-05-13 17:05:23.333761348 -0700
+++ b/fs/ext2/xattr_security.c	2010-05-13 17:10:27.694748597 -0700
@@ -67,7 +67,7 @@ ext2_init_security(struct inode *inode, 
 	return err;
 }
 
-struct xattr_handler ext2_xattr_security_handler = {
+const struct xattr_handler ext2_xattr_security_handler = {
 	.prefix	= XATTR_SECURITY_PREFIX,
 	.list	= ext2_xattr_security_list,
 	.get	= ext2_xattr_security_get,
--- a/fs/ext2/xattr_trusted.c	2010-05-13 17:05:23.343766146 -0700
+++ b/fs/ext2/xattr_trusted.c	2010-05-13 17:10:27.694748597 -0700
@@ -50,7 +50,7 @@ ext2_xattr_trusted_set(struct dentry *de
 			      value, size, flags);
 }
 
-struct xattr_handler ext2_xattr_trusted_handler = {
+const struct xattr_handler ext2_xattr_trusted_handler = {
 	.prefix	= XATTR_TRUSTED_PREFIX,
 	.list	= ext2_xattr_trusted_list,
 	.get	= ext2_xattr_trusted_get,
--- a/fs/ext2/xattr_user.c	2010-05-13 17:05:23.353761435 -0700
+++ b/fs/ext2/xattr_user.c	2010-05-13 17:10:27.694748597 -0700
@@ -54,7 +54,7 @@ ext2_xattr_user_set(struct dentry *dentr
 			      name, value, size, flags);
 }
 
-struct xattr_handler ext2_xattr_user_handler = {
+const struct xattr_handler ext2_xattr_user_handler = {
 	.prefix	= XATTR_USER_PREFIX,
 	.list	= ext2_xattr_user_list,
 	.get	= ext2_xattr_user_get,



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 04/10] Subject ext3: constify xattr handlers
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (2 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 03/10] ext2: " Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 05/10] ext4: constify xattr_handler Stephen Hemminger
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: ext3-const-xattr.patch --]
[-- Type: text/plain, Size: 5014 bytes --]


Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 fs/ext3/acl.c            |    4 ++--
 fs/ext3/xattr.c          |   10 +++++-----
 fs/ext3/xattr.h          |   12 ++++++------
 fs/ext3/xattr_security.c |    2 +-
 fs/ext3/xattr_trusted.c  |    2 +-
 fs/ext3/xattr_user.c     |    2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)

--- a/fs/ext3/acl.c	2010-05-13 16:45:57.792531346 -0700
+++ b/fs/ext3/acl.c	2010-05-13 16:46:21.703218008 -0700
@@ -456,7 +456,7 @@ release_and_out:
 	return error;
 }
 
-struct xattr_handler ext3_xattr_acl_access_handler = {
+const struct xattr_handler ext3_xattr_acl_access_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.list	= ext3_xattr_list_acl_access,
@@ -464,7 +464,7 @@ struct xattr_handler ext3_xattr_acl_acce
 	.set	= ext3_xattr_set_acl,
 };
 
-struct xattr_handler ext3_xattr_acl_default_handler = {
+const struct xattr_handler ext3_xattr_acl_default_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= ext3_xattr_list_acl_default,
--- a/fs/ext3/xattr.c	2010-05-13 16:46:30.312873934 -0700
+++ b/fs/ext3/xattr.c	2010-05-13 16:46:53.199523241 -0700
@@ -104,7 +104,7 @@ static int ext3_xattr_list(struct dentry
 
 static struct mb_cache *ext3_xattr_cache;
 
-static struct xattr_handler *ext3_xattr_handler_map[] = {
+static const struct xattr_handler *ext3_xattr_handler_map[] = {
 	[EXT3_XATTR_INDEX_USER]		     = &ext3_xattr_user_handler,
 #ifdef CONFIG_EXT3_FS_POSIX_ACL
 	[EXT3_XATTR_INDEX_POSIX_ACL_ACCESS]  = &ext3_xattr_acl_access_handler,
@@ -116,7 +116,7 @@ static struct xattr_handler *ext3_xattr_
 #endif
 };
 
-struct xattr_handler *ext3_xattr_handlers[] = {
+const struct xattr_handler *ext3_xattr_handlers[] = {
 	&ext3_xattr_user_handler,
 	&ext3_xattr_trusted_handler,
 #ifdef CONFIG_EXT3_FS_POSIX_ACL
@@ -129,10 +129,10 @@ struct xattr_handler *ext3_xattr_handler
 	NULL
 };
 
-static inline struct xattr_handler *
+static inline const struct xattr_handler *
 ext3_xattr_handler(int name_index)
 {
-	struct xattr_handler *handler = NULL;
+	const struct xattr_handler *handler = NULL;
 
 	if (name_index > 0 && name_index < ARRAY_SIZE(ext3_xattr_handler_map))
 		handler = ext3_xattr_handler_map[name_index];
@@ -338,7 +338,7 @@ ext3_xattr_list_entries(struct dentry *d
 	size_t rest = buffer_size;
 
 	for (; !IS_LAST_ENTRY(entry); entry = EXT3_XATTR_NEXT(entry)) {
-		struct xattr_handler *handler =
+		const struct xattr_handler *handler =
 			ext3_xattr_handler(entry->e_name_index);
 
 		if (handler) {
--- a/fs/ext3/xattr_security.c	2010-05-13 16:46:57.972534673 -0700
+++ b/fs/ext3/xattr_security.c	2010-05-13 16:47:04.415630434 -0700
@@ -69,7 +69,7 @@ ext3_init_security(handle_t *handle, str
 	return err;
 }
 
-struct xattr_handler ext3_xattr_security_handler = {
+const struct xattr_handler ext3_xattr_security_handler = {
 	.prefix	= XATTR_SECURITY_PREFIX,
 	.list	= ext3_xattr_security_list,
 	.get	= ext3_xattr_security_get,
--- a/fs/ext3/xattr_trusted.c	2010-05-13 16:47:11.542516792 -0700
+++ b/fs/ext3/xattr_trusted.c	2010-05-13 16:47:19.183768400 -0700
@@ -51,7 +51,7 @@ ext3_xattr_trusted_set(struct dentry *de
 			      value, size, flags);
 }
 
-struct xattr_handler ext3_xattr_trusted_handler = {
+const struct xattr_handler ext3_xattr_trusted_handler = {
 	.prefix	= XATTR_TRUSTED_PREFIX,
 	.list	= ext3_xattr_trusted_list,
 	.get	= ext3_xattr_trusted_get,
--- a/fs/ext3/xattr_user.c	2010-05-13 16:47:27.212848141 -0700
+++ b/fs/ext3/xattr_user.c	2010-05-13 16:47:33.247904276 -0700
@@ -54,7 +54,7 @@ ext3_xattr_user_set(struct dentry *dentr
 			      name, value, size, flags);
 }
 
-struct xattr_handler ext3_xattr_user_handler = {
+const struct xattr_handler ext3_xattr_user_handler = {
 	.prefix	= XATTR_USER_PREFIX,
 	.list	= ext3_xattr_user_list,
 	.get	= ext3_xattr_user_get,
--- a/fs/ext3/xattr.h	2010-05-13 16:51:37.453136790 -0700
+++ b/fs/ext3/xattr.h	2010-05-13 16:52:45.994520797 -0700
@@ -58,11 +58,11 @@ struct ext3_xattr_entry {
 
 # ifdef CONFIG_EXT3_FS_XATTR
 
-extern struct xattr_handler ext3_xattr_user_handler;
-extern struct xattr_handler ext3_xattr_trusted_handler;
-extern struct xattr_handler ext3_xattr_acl_access_handler;
-extern struct xattr_handler ext3_xattr_acl_default_handler;
-extern struct xattr_handler ext3_xattr_security_handler;
+extern const struct xattr_handler ext3_xattr_user_handler;
+extern const struct xattr_handler ext3_xattr_trusted_handler;
+extern const struct xattr_handler ext3_xattr_acl_access_handler;
+extern const struct xattr_handler ext3_xattr_acl_default_handler;
+extern const struct xattr_handler ext3_xattr_security_handler;
 
 extern ssize_t ext3_listxattr(struct dentry *, char *, size_t);
 
@@ -76,7 +76,7 @@ extern void ext3_xattr_put_super(struct 
 extern int init_ext3_xattr(void);
 extern void exit_ext3_xattr(void);
 
-extern struct xattr_handler *ext3_xattr_handlers[];
+extern const struct xattr_handler *ext3_xattr_handlers[];
 
 # else  /* CONFIG_EXT3_FS_XATTR */
 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 05/10] ext4: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (3 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 04/10] Subject ext3: constify xattr handlers Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 06/10] reiserfs: " Stephen Hemminger
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: ext4-const-xattr.patch --]
[-- Type: text/plain, Size: 5016 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 fs/ext4/acl.c            |    4 ++--
 fs/ext4/xattr.c          |   10 +++++-----
 fs/ext4/xattr.h          |   12 ++++++------
 fs/ext4/xattr_security.c |    2 +-
 fs/ext4/xattr_trusted.c  |    2 +-
 fs/ext4/xattr_user.c     |    2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)

--- a/fs/ext4/acl.c	2010-05-13 16:36:51.883761863 -0700
+++ b/fs/ext4/acl.c	2010-05-13 16:37:00.160557334 -0700
@@ -454,7 +454,7 @@ release_and_out:
 	return error;
 }
 
-struct xattr_handler ext4_xattr_acl_access_handler = {
+const struct xattr_handler ext4_xattr_acl_access_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.list	= ext4_xattr_list_acl_access,
@@ -462,7 +462,7 @@ struct xattr_handler ext4_xattr_acl_acce
 	.set	= ext4_xattr_set_acl,
 };
 
-struct xattr_handler ext4_xattr_acl_default_handler = {
+const struct xattr_handler ext4_xattr_acl_default_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= ext4_xattr_list_acl_default,
--- a/fs/ext4/xattr.c	2010-05-13 16:35:40.623502550 -0700
+++ b/fs/ext4/xattr.c	2010-05-13 16:38:59.742956015 -0700
@@ -97,7 +97,7 @@ static int ext4_xattr_list(struct dentry
 
 static struct mb_cache *ext4_xattr_cache;
 
-static struct xattr_handler *ext4_xattr_handler_map[] = {
+static const struct xattr_handler *ext4_xattr_handler_map[] = {
 	[EXT4_XATTR_INDEX_USER]		     = &ext4_xattr_user_handler,
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
 	[EXT4_XATTR_INDEX_POSIX_ACL_ACCESS]  = &ext4_xattr_acl_access_handler,
@@ -109,7 +109,7 @@ static struct xattr_handler *ext4_xattr_
 #endif
 };
 
-struct xattr_handler *ext4_xattr_handlers[] = {
+const struct xattr_handler *ext4_xattr_handlers[] = {
 	&ext4_xattr_user_handler,
 	&ext4_xattr_trusted_handler,
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
@@ -122,10 +122,10 @@ struct xattr_handler *ext4_xattr_handler
 	NULL
 };
 
-static inline struct xattr_handler *
+static inline const struct xattr_handler *
 ext4_xattr_handler(int name_index)
 {
-	struct xattr_handler *handler = NULL;
+	const struct xattr_handler *handler = NULL;
 
 	if (name_index > 0 && name_index < ARRAY_SIZE(ext4_xattr_handler_map))
 		handler = ext4_xattr_handler_map[name_index];
@@ -332,7 +332,7 @@ ext4_xattr_list_entries(struct dentry *d
 	size_t rest = buffer_size;
 
 	for (; !IS_LAST_ENTRY(entry); entry = EXT4_XATTR_NEXT(entry)) {
-		struct xattr_handler *handler =
+		const struct xattr_handler *handler =
 			ext4_xattr_handler(entry->e_name_index);
 
 		if (handler) {
--- a/fs/ext4/xattr.h	2010-05-13 16:38:42.563496202 -0700
+++ b/fs/ext4/xattr.h	2010-05-13 16:39:46.394784046 -0700
@@ -65,11 +65,11 @@ struct ext4_xattr_entry {
 
 # ifdef CONFIG_EXT4_FS_XATTR
 
-extern struct xattr_handler ext4_xattr_user_handler;
-extern struct xattr_handler ext4_xattr_trusted_handler;
-extern struct xattr_handler ext4_xattr_acl_access_handler;
-extern struct xattr_handler ext4_xattr_acl_default_handler;
-extern struct xattr_handler ext4_xattr_security_handler;
+extern const struct xattr_handler ext4_xattr_user_handler;
+extern const struct xattr_handler ext4_xattr_trusted_handler;
+extern const struct xattr_handler ext4_xattr_acl_access_handler;
+extern const struct xattr_handler ext4_xattr_acl_default_handler;
+extern const struct xattr_handler ext4_xattr_security_handler;
 
 extern ssize_t ext4_listxattr(struct dentry *, char *, size_t);
 
@@ -86,7 +86,7 @@ extern int ext4_expand_extra_isize_ea(st
 extern int init_ext4_xattr(void);
 extern void exit_ext4_xattr(void);
 
-extern struct xattr_handler *ext4_xattr_handlers[];
+extern const struct xattr_handler *ext4_xattr_handlers[];
 
 # else  /* CONFIG_EXT4_FS_XATTR */
 
--- a/fs/ext4/xattr_security.c	2010-05-13 16:37:25.982511671 -0700
+++ b/fs/ext4/xattr_security.c	2010-05-13 16:37:29.742530038 -0700
@@ -69,7 +69,7 @@ ext4_init_security(handle_t *handle, str
 	return err;
 }
 
-struct xattr_handler ext4_xattr_security_handler = {
+const struct xattr_handler ext4_xattr_security_handler = {
 	.prefix	= XATTR_SECURITY_PREFIX,
 	.list	= ext4_xattr_security_list,
 	.get	= ext4_xattr_security_get,
--- a/fs/ext4/xattr_trusted.c	2010-05-13 16:37:33.893136689 -0700
+++ b/fs/ext4/xattr_trusted.c	2010-05-13 16:37:37.425080782 -0700
@@ -51,7 +51,7 @@ ext4_xattr_trusted_set(struct dentry *de
 			      name, value, size, flags);
 }
 
-struct xattr_handler ext4_xattr_trusted_handler = {
+const struct xattr_handler ext4_xattr_trusted_handler = {
 	.prefix	= XATTR_TRUSTED_PREFIX,
 	.list	= ext4_xattr_trusted_list,
 	.get	= ext4_xattr_trusted_get,
--- a/fs/ext4/xattr_user.c	2010-05-13 16:37:40.893160719 -0700
+++ b/fs/ext4/xattr_user.c	2010-05-13 16:37:44.545173100 -0700
@@ -54,7 +54,7 @@ ext4_xattr_user_set(struct dentry *dentr
 			      name, value, size, flags);
 }
 
-struct xattr_handler ext4_xattr_user_handler = {
+const struct xattr_handler ext4_xattr_user_handler = {
 	.prefix	= XATTR_USER_PREFIX,
 	.list	= ext4_xattr_user_list,
 	.get	= ext4_xattr_user_get,



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 06/10] reiserfs: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (4 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 05/10] ext4: constify xattr_handler Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 07/10] xfs: " Stephen Hemminger
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: reiserfs-const-xattr.patch --]
[-- Type: text/plain, Size: 6015 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 fs/reiserfs/xattr.c            |   16 ++++++++--------
 fs/reiserfs/xattr_acl.c        |    4 ++--
 fs/reiserfs/xattr_security.c   |    2 +-
 fs/reiserfs/xattr_trusted.c    |    2 +-
 fs/reiserfs/xattr_user.c       |    2 +-
 include/linux/reiserfs_acl.h   |    4 ++--
 include/linux/reiserfs_xattr.h |    6 +++---
 7 files changed, 18 insertions(+), 18 deletions(-)

--- a/fs/reiserfs/xattr.c	2010-05-13 17:12:49.282873552 -0700
+++ b/fs/reiserfs/xattr.c	2010-05-13 17:13:50.792529727 -0700
@@ -723,11 +723,11 @@ out:
 			(handler) = *(handlers)++)
 
 /* This is the implementation for the xattr plugin infrastructure */
-static inline struct xattr_handler *
-find_xattr_handler_prefix(struct xattr_handler **handlers,
+static inline const struct xattr_handler *
+find_xattr_handler_prefix(const struct xattr_handler **handlers,
 			   const char *name)
 {
-	struct xattr_handler *xah;
+	const struct xattr_handler *xah;
 
 	if (!handlers)
 		return NULL;
@@ -748,7 +748,7 @@ ssize_t
 reiserfs_getxattr(struct dentry * dentry, const char *name, void *buffer,
 		  size_t size)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
 
@@ -767,7 +767,7 @@ int
 reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value,
 		  size_t size, int flags)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 
 	handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
 
@@ -784,7 +784,7 @@ reiserfs_setxattr(struct dentry *dentry,
  */
 int reiserfs_removexattr(struct dentry *dentry, const char *name)
 {
-	struct xattr_handler *handler;
+	const struct xattr_handler *handler;
 	handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
 
 	if (!handler || get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
@@ -807,7 +807,7 @@ static int listxattr_filler(void *buf, c
 	size_t size;
 	if (name[0] != '.' ||
 	    (namelen != 1 && (name[1] != '.' || namelen != 2))) {
-		struct xattr_handler *handler;
+		const struct xattr_handler *handler;
 		handler = find_xattr_handler_prefix(b->dentry->d_sb->s_xattr,
 						    name);
 		if (!handler)	/* Unsupported xattr name */
@@ -920,7 +920,7 @@ static int create_privroot(struct dentry
 #endif
 
 /* Actual operations that are exported to VFS-land */
-struct xattr_handler *reiserfs_xattr_handlers[] = {
+const struct xattr_handler *reiserfs_xattr_handlers[] = {
 #ifdef CONFIG_REISERFS_FS_XATTR
 	&reiserfs_xattr_user_handler,
 	&reiserfs_xattr_trusted_handler,
--- a/fs/reiserfs/xattr_acl.c	2010-05-13 17:12:49.304100248 -0700
+++ b/fs/reiserfs/xattr_acl.c	2010-05-13 17:13:11.352635720 -0700
@@ -500,7 +500,7 @@ static size_t posix_acl_access_list(stru
 	return size;
 }
 
-struct xattr_handler reiserfs_posix_acl_access_handler = {
+const struct xattr_handler reiserfs_posix_acl_access_handler = {
 	.prefix = POSIX_ACL_XATTR_ACCESS,
 	.flags = ACL_TYPE_ACCESS,
 	.get = posix_acl_get,
@@ -520,7 +520,7 @@ static size_t posix_acl_default_list(str
 	return size;
 }
 
-struct xattr_handler reiserfs_posix_acl_default_handler = {
+const struct xattr_handler reiserfs_posix_acl_default_handler = {
 	.prefix = POSIX_ACL_XATTR_DEFAULT,
 	.flags = ACL_TYPE_DEFAULT,
 	.get = posix_acl_get,
--- a/fs/reiserfs/xattr_security.c	2010-05-13 17:12:49.314074286 -0700
+++ b/fs/reiserfs/xattr_security.c	2010-05-13 17:13:55.752842338 -0700
@@ -111,7 +111,7 @@ void reiserfs_security_free(struct reise
 	sec->value = NULL;
 }
 
-struct xattr_handler reiserfs_xattr_security_handler = {
+const struct xattr_handler reiserfs_xattr_security_handler = {
 	.prefix = XATTR_SECURITY_PREFIX,
 	.get = security_get,
 	.set = security_set,
--- a/fs/reiserfs/xattr_trusted.c	2010-05-13 17:12:49.334107584 -0700
+++ b/fs/reiserfs/xattr_trusted.c	2010-05-13 17:14:24.352512117 -0700
@@ -48,7 +48,7 @@ static size_t trusted_list(struct dentry
 	return len;
 }
 
-struct xattr_handler reiserfs_xattr_trusted_handler = {
+const struct xattr_handler reiserfs_xattr_trusted_handler = {
 	.prefix = XATTR_TRUSTED_PREFIX,
 	.get = trusted_get,
 	.set = trusted_set,
--- a/fs/reiserfs/xattr_user.c	2010-05-13 17:12:49.344074206 -0700
+++ b/fs/reiserfs/xattr_user.c	2010-05-13 17:14:23.852534779 -0700
@@ -44,7 +44,7 @@ static size_t user_list(struct dentry *d
 	return len;
 }
 
-struct xattr_handler reiserfs_xattr_user_handler = {
+const struct xattr_handler reiserfs_xattr_user_handler = {
 	.prefix = XATTR_USER_PREFIX,
 	.get = user_get,
 	.set = user_set,
--- a/include/linux/reiserfs_acl.h	2010-05-13 17:35:46.217861592 -0700
+++ b/include/linux/reiserfs_acl.h	2010-05-13 17:36:04.867540723 -0700
@@ -53,8 +53,8 @@ int reiserfs_inherit_default_acl(struct 
 				 struct inode *dir, struct dentry *dentry,
 				 struct inode *inode);
 int reiserfs_cache_default_acl(struct inode *dir);
-extern struct xattr_handler reiserfs_posix_acl_default_handler;
-extern struct xattr_handler reiserfs_posix_acl_access_handler;
+extern const struct xattr_handler reiserfs_posix_acl_default_handler;
+extern const struct xattr_handler reiserfs_posix_acl_access_handler;
 
 #else
 
--- a/include/linux/reiserfs_xattr.h	2010-05-13 17:36:12.209134352 -0700
+++ b/include/linux/reiserfs_xattr.h	2010-05-13 17:36:29.207858107 -0700
@@ -58,9 +58,9 @@ int reiserfs_xattr_set_handle(struct rei
 			      struct inode *, const char *, const void *,
 			      size_t, int);
 
-extern struct xattr_handler reiserfs_xattr_user_handler;
-extern struct xattr_handler reiserfs_xattr_trusted_handler;
-extern struct xattr_handler reiserfs_xattr_security_handler;
+extern const struct xattr_handler reiserfs_xattr_user_handler;
+extern const struct xattr_handler reiserfs_xattr_trusted_handler;
+extern const struct xattr_handler reiserfs_xattr_security_handler;
 #ifdef CONFIG_REISERFS_FS_SECURITY
 int reiserfs_security_init(struct inode *dir, struct inode *inode,
 			   struct reiserfs_security_handle *sec);



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 07/10] xfs: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (5 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 06/10] reiserfs: " Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 08/10] jffs2: " Stephen Hemminger
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: xfs-xattr.patch --]
[-- Type: text/plain, Size: 3080 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/fs/xfs/linux-2.6/xfs_acl.c	2010-05-13 17:20:23.783786528 -0700
+++ b/fs/xfs/linux-2.6/xfs_acl.c	2010-05-13 17:21:51.199172670 -0700
@@ -440,14 +440,14 @@ xfs_xattr_acl_set(struct dentry *dentry,
 	return error;
 }
 
-struct xattr_handler xfs_xattr_acl_access_handler = {
+const struct xattr_handler xfs_xattr_acl_access_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.get	= xfs_xattr_acl_get,
 	.set	= xfs_xattr_acl_set,
 };
 
-struct xattr_handler xfs_xattr_acl_default_handler = {
+const struct xattr_handler xfs_xattr_acl_default_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.get	= xfs_xattr_acl_get,
--- a/fs/xfs/linux-2.6/xfs_super.h	2010-05-13 17:20:23.813789995 -0700
+++ b/fs/xfs/linux-2.6/xfs_super.h	2010-05-13 17:22:26.552530771 -0700
@@ -85,7 +85,7 @@ extern __uint64_t xfs_max_file_offset(un
 extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
 
 extern const struct export_operations xfs_export_operations;
-extern struct xattr_handler *xfs_xattr_handlers[];
+extern const struct xattr_handler *xfs_xattr_handlers[];
 extern const struct quotactl_ops xfs_quotactl_operations;
 
 #define XFS_M(sb)		((struct xfs_mount *)((sb)->s_fs_info))
--- a/fs/xfs/linux-2.6/xfs_xattr.c	2010-05-13 17:20:23.833761878 -0700
+++ b/fs/xfs/linux-2.6/xfs_xattr.c	2010-05-13 17:22:07.034704050 -0700
@@ -72,28 +72,28 @@ xfs_xattr_set(struct dentry *dentry, con
 				(void *)value, size, xflags);
 }
 
-static struct xattr_handler xfs_xattr_user_handler = {
+static const struct xattr_handler xfs_xattr_user_handler = {
 	.prefix	= XATTR_USER_PREFIX,
 	.flags	= 0, /* no flags implies user namespace */
 	.get	= xfs_xattr_get,
 	.set	= xfs_xattr_set,
 };
 
-static struct xattr_handler xfs_xattr_trusted_handler = {
+static const struct xattr_handler xfs_xattr_trusted_handler = {
 	.prefix	= XATTR_TRUSTED_PREFIX,
 	.flags	= ATTR_ROOT,
 	.get	= xfs_xattr_get,
 	.set	= xfs_xattr_set,
 };
 
-static struct xattr_handler xfs_xattr_security_handler = {
+static const struct xattr_handler xfs_xattr_security_handler = {
 	.prefix	= XATTR_SECURITY_PREFIX,
 	.flags	= ATTR_SECURE,
 	.get	= xfs_xattr_get,
 	.set	= xfs_xattr_set,
 };
 
-struct xattr_handler *xfs_xattr_handlers[] = {
+const struct xattr_handler *xfs_xattr_handlers[] = {
 	&xfs_xattr_user_handler,
 	&xfs_xattr_trusted_handler,
 	&xfs_xattr_security_handler,
--- a/fs/xfs/xfs_acl.h	2010-05-13 17:20:23.843783965 -0700
+++ b/fs/xfs/xfs_acl.h	2010-05-13 17:21:42.583156613 -0700
@@ -49,8 +49,8 @@ extern int xfs_acl_chmod(struct inode *i
 extern int posix_acl_access_exists(struct inode *inode);
 extern int posix_acl_default_exists(struct inode *inode);
 
-extern struct xattr_handler xfs_xattr_acl_access_handler;
-extern struct xattr_handler xfs_xattr_acl_default_handler;
+extern const struct xattr_handler xfs_xattr_acl_access_handler;
+extern const struct xattr_handler xfs_xattr_acl_default_handler;
 #else
 # define xfs_check_acl					NULL
 # define xfs_get_acl(inode, type)			NULL



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 08/10] jffs2: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (6 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 07/10] xfs: " Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 09/10] ocfs: " Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 10/10] gfs: " Stephen Hemminger
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: jffs2-xattr.patch --]
[-- Type: text/plain, Size: 4962 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/fs/jffs2/acl.c	2010-05-13 17:40:54.017455755 -0700
+++ b/fs/jffs2/acl.c	2010-05-13 17:42:37.396467274 -0700
@@ -419,7 +419,7 @@ static int jffs2_acl_setxattr(struct den
 	return rc;
 }
 
-struct xattr_handler jffs2_acl_access_xattr_handler = {
+const struct xattr_handler jffs2_acl_access_xattr_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= jffs2_acl_access_listxattr,
@@ -427,7 +427,7 @@ struct xattr_handler jffs2_acl_access_xa
 	.set	= jffs2_acl_setxattr,
 };
 
-struct xattr_handler jffs2_acl_default_xattr_handler = {
+const struct xattr_handler jffs2_acl_default_xattr_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= jffs2_acl_default_listxattr,
--- a/fs/jffs2/acl.h	2010-05-13 17:40:54.037479787 -0700
+++ b/fs/jffs2/acl.h	2010-05-13 17:41:36.976719562 -0700
@@ -31,8 +31,8 @@ extern int jffs2_acl_chmod(struct inode 
 extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *);
 extern int jffs2_init_acl_post(struct inode *);
 
-extern struct xattr_handler jffs2_acl_access_xattr_handler;
-extern struct xattr_handler jffs2_acl_default_xattr_handler;
+extern const struct xattr_handler jffs2_acl_access_xattr_handler;
+extern const struct xattr_handler jffs2_acl_default_xattr_handler;
 
 #else
 
--- a/fs/jffs2/security.c	2010-05-13 17:40:54.047476974 -0700
+++ b/fs/jffs2/security.c	2010-05-13 17:41:42.186537611 -0700
@@ -77,7 +77,7 @@ static size_t jffs2_security_listxattr(s
 	return retlen;
 }
 
-struct xattr_handler jffs2_security_xattr_handler = {
+const struct xattr_handler jffs2_security_xattr_handler = {
 	.prefix = XATTR_SECURITY_PREFIX,
 	.list = jffs2_security_listxattr,
 	.set = jffs2_security_setxattr,
--- a/fs/jffs2/xattr.c	2010-05-13 17:40:54.077485153 -0700
+++ b/fs/jffs2/xattr.c	2010-05-13 17:42:07.050578873 -0700
@@ -904,7 +904,7 @@ struct jffs2_xattr_datum *jffs2_setup_xa
  * do_jffs2_setxattr(inode, xprefix, xname, buffer, size, flags)
  *   is an implementation of setxattr handler on jffs2.
  * -------------------------------------------------- */
-struct xattr_handler *jffs2_xattr_handlers[] = {
+const struct xattr_handler *jffs2_xattr_handlers[] = {
 	&jffs2_user_xattr_handler,
 #ifdef CONFIG_JFFS2_FS_SECURITY
 	&jffs2_security_xattr_handler,
@@ -917,8 +917,8 @@ struct xattr_handler *jffs2_xattr_handle
 	NULL
 };
 
-static struct xattr_handler *xprefix_to_handler(int xprefix) {
-	struct xattr_handler *ret;
+static const struct xattr_handler *xprefix_to_handler(int xprefix) {
+	const struct xattr_handler *ret;
 
 	switch (xprefix) {
 	case JFFS2_XPREFIX_USER:
@@ -955,7 +955,7 @@ ssize_t jffs2_listxattr(struct dentry *d
 	struct jffs2_inode_cache *ic = f->inocache;
 	struct jffs2_xattr_ref *ref, **pref;
 	struct jffs2_xattr_datum *xd;
-	struct xattr_handler *xhandle;
+	const struct xattr_handler *xhandle;
 	ssize_t len, rc;
 	int retry = 0;
 
--- a/fs/jffs2/xattr.h	2010-05-13 17:40:54.097476795 -0700
+++ b/fs/jffs2/xattr.h	2010-05-13 17:42:36.816518351 -0700
@@ -93,9 +93,9 @@ extern int do_jffs2_getxattr(struct inod
 extern int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
 			     const char *buffer, size_t size, int flags);
 
-extern struct xattr_handler *jffs2_xattr_handlers[];
-extern struct xattr_handler jffs2_user_xattr_handler;
-extern struct xattr_handler jffs2_trusted_xattr_handler;
+extern const struct xattr_handler *jffs2_xattr_handlers[];
+extern const struct xattr_handler jffs2_user_xattr_handler;
+extern const struct xattr_handler jffs2_trusted_xattr_handler;
 
 extern ssize_t jffs2_listxattr(struct dentry *, char *, size_t);
 #define jffs2_getxattr		generic_getxattr
@@ -122,7 +122,7 @@ extern ssize_t jffs2_listxattr(struct de
 
 #ifdef CONFIG_JFFS2_FS_SECURITY
 extern int jffs2_init_security(struct inode *inode, struct inode *dir);
-extern struct xattr_handler jffs2_security_xattr_handler;
+extern const struct xattr_handler jffs2_security_xattr_handler;
 #else
 #define jffs2_init_security(inode,dir)	(0)
 #endif /* CONFIG_JFFS2_FS_SECURITY */
--- a/fs/jffs2/xattr_trusted.c	2010-05-13 17:40:54.107478507 -0700
+++ b/fs/jffs2/xattr_trusted.c	2010-05-13 17:42:26.696230759 -0700
@@ -47,7 +47,7 @@ static size_t jffs2_trusted_listxattr(st
 	return retlen;
 }
 
-struct xattr_handler jffs2_trusted_xattr_handler = {
+const struct xattr_handler jffs2_trusted_xattr_handler = {
 	.prefix = XATTR_TRUSTED_PREFIX,
 	.list = jffs2_trusted_listxattr,
 	.set = jffs2_trusted_setxattr,
--- a/fs/jffs2/xattr_user.c	2010-05-13 17:40:54.127483416 -0700
+++ b/fs/jffs2/xattr_user.c	2010-05-13 17:42:31.046205906 -0700
@@ -47,7 +47,7 @@ static size_t jffs2_user_listxattr(struc
 	return retlen;
 }
 
-struct xattr_handler jffs2_user_xattr_handler = {
+const struct xattr_handler jffs2_user_xattr_handler = {
 	.prefix = XATTR_USER_PREFIX,
 	.list = jffs2_user_listxattr,
 	.set = jffs2_user_setxattr,



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 09/10] ocfs: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (7 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 08/10] jffs2: " Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  2010-05-14  0:53 ` [PATCH 10/10] gfs: " Stephen Hemminger
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: ocfs-xattr.patch --]
[-- Type: text/plain, Size: 4068 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 fs/ocfs2/acl.c   |    4 ++--
 fs/ocfs2/xattr.c |   12 ++++++------
 fs/ocfs2/xattr.h |   12 ++++++------
 3 files changed, 14 insertions(+), 14 deletions(-)

--- a/fs/ocfs2/acl.c	2010-05-13 17:43:09.657767772 -0700
+++ b/fs/ocfs2/acl.c	2010-05-13 17:44:23.563051789 -0700
@@ -489,7 +489,7 @@ cleanup:
 	return ret;
 }
 
-struct xattr_handler ocfs2_xattr_acl_access_handler = {
+const struct xattr_handler ocfs2_xattr_acl_access_handler = {
 	.prefix	= POSIX_ACL_XATTR_ACCESS,
 	.flags	= ACL_TYPE_ACCESS,
 	.list	= ocfs2_xattr_list_acl_access,
@@ -497,7 +497,7 @@ struct xattr_handler ocfs2_xattr_acl_acc
 	.set	= ocfs2_xattr_set_acl,
 };
 
-struct xattr_handler ocfs2_xattr_acl_default_handler = {
+const struct xattr_handler ocfs2_xattr_acl_default_handler = {
 	.prefix	= POSIX_ACL_XATTR_DEFAULT,
 	.flags	= ACL_TYPE_DEFAULT,
 	.list	= ocfs2_xattr_list_acl_default,
--- a/fs/ocfs2/xattr.c	2010-05-13 17:43:09.687806842 -0700
+++ b/fs/ocfs2/xattr.c	2010-05-13 17:44:23.136539286 -0700
@@ -96,7 +96,7 @@ static struct ocfs2_xattr_def_value_root
 	.xv.xr_list.l_count = cpu_to_le16(1),
 };
 
-struct xattr_handler *ocfs2_xattr_handlers[] = {
+const struct xattr_handler *ocfs2_xattr_handlers[] = {
 	&ocfs2_xattr_user_handler,
 	&ocfs2_xattr_acl_access_handler,
 	&ocfs2_xattr_acl_default_handler,
@@ -105,7 +105,7 @@ struct xattr_handler *ocfs2_xattr_handle
 	NULL
 };
 
-static struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = {
+static const struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = {
 	[OCFS2_XATTR_INDEX_USER]	= &ocfs2_xattr_user_handler,
 	[OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS]
 					= &ocfs2_xattr_acl_access_handler,
@@ -539,7 +539,7 @@ static int ocfs2_read_xattr_block(struct
 
 static inline const char *ocfs2_xattr_prefix(int name_index)
 {
-	struct xattr_handler *handler = NULL;
+	const struct xattr_handler *handler = NULL;
 
 	if (name_index > 0 && name_index < OCFS2_XATTR_MAX)
 		handler = ocfs2_xattr_handler_map[name_index];
@@ -7234,7 +7234,7 @@ int ocfs2_init_security_set(handle_t *ha
 				     xattr_ac, data_ac);
 }
 
-struct xattr_handler ocfs2_xattr_security_handler = {
+const struct xattr_handler ocfs2_xattr_security_handler = {
 	.prefix	= XATTR_SECURITY_PREFIX,
 	.list	= ocfs2_xattr_security_list,
 	.get	= ocfs2_xattr_security_get,
@@ -7278,7 +7278,7 @@ static int ocfs2_xattr_trusted_set(struc
 			       name, value, size, flags);
 }
 
-struct xattr_handler ocfs2_xattr_trusted_handler = {
+const struct xattr_handler ocfs2_xattr_trusted_handler = {
 	.prefix	= XATTR_TRUSTED_PREFIX,
 	.list	= ocfs2_xattr_trusted_list,
 	.get	= ocfs2_xattr_trusted_get,
@@ -7334,7 +7334,7 @@ static int ocfs2_xattr_user_set(struct d
 			       name, value, size, flags);
 }
 
-struct xattr_handler ocfs2_xattr_user_handler = {
+const struct xattr_handler ocfs2_xattr_user_handler = {
 	.prefix	= XATTR_USER_PREFIX,
 	.list	= ocfs2_xattr_user_list,
 	.get	= ocfs2_xattr_user_get,
--- a/fs/ocfs2/xattr.h	2010-05-13 17:43:09.697815965 -0700
+++ b/fs/ocfs2/xattr.h	2010-05-13 17:44:14.756229017 -0700
@@ -37,12 +37,12 @@ struct ocfs2_security_xattr_info {
 	size_t value_len;
 };
 
-extern struct xattr_handler ocfs2_xattr_user_handler;
-extern struct xattr_handler ocfs2_xattr_trusted_handler;
-extern struct xattr_handler ocfs2_xattr_security_handler;
-extern struct xattr_handler ocfs2_xattr_acl_access_handler;
-extern struct xattr_handler ocfs2_xattr_acl_default_handler;
-extern struct xattr_handler *ocfs2_xattr_handlers[];
+extern const struct xattr_handler ocfs2_xattr_user_handler;
+extern const struct xattr_handler ocfs2_xattr_trusted_handler;
+extern const struct xattr_handler ocfs2_xattr_security_handler;
+extern const struct xattr_handler ocfs2_xattr_acl_access_handler;
+extern const struct xattr_handler ocfs2_xattr_acl_default_handler;
+extern const struct xattr_handler *ocfs2_xattr_handlers[];
 
 ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
 int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int,



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 10/10] gfs: constify xattr_handler
  2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
                   ` (8 preceding siblings ...)
  2010-05-14  0:53 ` [PATCH 09/10] ocfs: " Stephen Hemminger
@ 2010-05-14  0:53 ` Stephen Hemminger
  9 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2010-05-14  0:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel

[-- Attachment #1: gfs-xattr.patch --]
[-- Type: text/plain, Size: 2421 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
 fs/gfs2/acl.c   |    2 +-
 fs/gfs2/acl.h   |    2 +-
 fs/gfs2/super.h |    2 +-
 fs/gfs2/xattr.c |    6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

--- a/fs/gfs2/acl.c	2010-05-13 17:44:58.968080096 -0700
+++ b/fs/gfs2/acl.c	2010-05-13 17:45:32.727563724 -0700
@@ -335,7 +335,7 @@ out:
 	return error;
 }
 
-struct xattr_handler gfs2_xattr_system_handler = {
+const struct xattr_handler gfs2_xattr_system_handler = {
 	.prefix = XATTR_SYSTEM_PREFIX,
 	.flags  = GFS2_EATYPE_SYS,
 	.get    = gfs2_xattr_system_get,
--- a/fs/gfs2/acl.h	2010-05-13 17:44:58.978080437 -0700
+++ b/fs/gfs2/acl.h	2010-05-13 17:46:07.889555241 -0700
@@ -19,6 +19,6 @@
 extern int gfs2_check_acl(struct inode *inode, int mask);
 extern int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode);
 extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr);
-extern struct xattr_handler gfs2_xattr_system_handler;
+extern const struct xattr_handler gfs2_xattr_system_handler;
 
 #endif /* __ACL_DOT_H__ */
--- a/fs/gfs2/super.h	2010-05-13 17:44:58.988080091 -0700
+++ b/fs/gfs2/super.h	2010-05-13 17:46:06.026536827 -0700
@@ -54,7 +54,7 @@ extern struct file_system_type gfs2meta_
 extern const struct export_operations gfs2_export_ops;
 extern const struct super_operations gfs2_super_ops;
 extern const struct dentry_operations gfs2_dops;
-extern struct xattr_handler *gfs2_xattr_handlers[];
+extern const struct xattr_handler *gfs2_xattr_handlers[];
 
 #endif /* __SUPER_DOT_H__ */
 
--- a/fs/gfs2/xattr.c	2010-05-13 17:44:58.998080311 -0700
+++ b/fs/gfs2/xattr.c	2010-05-13 17:46:08.401554064 -0700
@@ -1535,21 +1535,21 @@ out_alloc:
 	return error;
 }
 
-static struct xattr_handler gfs2_xattr_user_handler = {
+static const struct xattr_handler gfs2_xattr_user_handler = {
 	.prefix = XATTR_USER_PREFIX,
 	.flags  = GFS2_EATYPE_USR,
 	.get    = gfs2_xattr_get,
 	.set    = gfs2_xattr_set,
 };
 
-static struct xattr_handler gfs2_xattr_security_handler = {
+static const struct xattr_handler gfs2_xattr_security_handler = {
 	.prefix = XATTR_SECURITY_PREFIX,
 	.flags  = GFS2_EATYPE_SECURITY,
 	.get    = gfs2_xattr_get,
 	.set    = gfs2_xattr_set,
 };
 
-struct xattr_handler *gfs2_xattr_handlers[] = {
+const struct xattr_handler *gfs2_xattr_handlers[] = {
 	&gfs2_xattr_user_handler,
 	&gfs2_xattr_security_handler,
 	&gfs2_xattr_system_handler,



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-05-14  2:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14  0:53 [PATCH 00/10] Make xattr_handler constant patches Stephen Hemminger
2010-05-14  0:53 ` [PATCH 01/10] fs: xattr_handler table should be const Stephen Hemminger
2010-05-14  0:53 ` [PATCH 02/10] btrfs: constify xattr_handler Stephen Hemminger
2010-05-14  0:53 ` [PATCH 03/10] ext2: " Stephen Hemminger
2010-05-14  0:53 ` [PATCH 04/10] Subject ext3: constify xattr handlers Stephen Hemminger
2010-05-14  0:53 ` [PATCH 05/10] ext4: constify xattr_handler Stephen Hemminger
2010-05-14  0:53 ` [PATCH 06/10] reiserfs: " Stephen Hemminger
2010-05-14  0:53 ` [PATCH 07/10] xfs: " Stephen Hemminger
2010-05-14  0:53 ` [PATCH 08/10] jffs2: " Stephen Hemminger
2010-05-14  0:53 ` [PATCH 09/10] ocfs: " Stephen Hemminger
2010-05-14  0:53 ` [PATCH 10/10] gfs: " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).