linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 06/10] reiserfs: constify xattr_handler
Date: Thu, 13 May 2010 17:53:19 -0700	[thread overview]
Message-ID: <20100514005408.989132613@vyatta.com> (raw)
In-Reply-To: 20100514005313.884038885@vyatta.com

[-- 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);



  parent reply	other threads:[~2010-05-14  2:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Stephen Hemminger [this message]
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

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=20100514005408.989132613@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).