From: Stephen Hemminger <shemminger@vyatta.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 08/10] jffs2: constify xattr_handler
Date: Thu, 13 May 2010 17:53:21 -0700 [thread overview]
Message-ID: <20100514005409.149637049@vyatta.com> (raw)
In-Reply-To: 20100514005313.884038885@vyatta.com
[-- 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,
next prev parent reply other threads:[~2010-05-14 1:58 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 ` [PATCH 06/10] reiserfs: " Stephen Hemminger
2010-05-14 0:53 ` [PATCH 07/10] xfs: " Stephen Hemminger
2010-05-14 0:53 ` Stephen Hemminger [this message]
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=20100514005409.149637049@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).