jffs2: constify xattr_handler
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
46e58764f0
commit
365f0cb9d2
7 changed files with 15 additions and 15 deletions
|
@ -419,7 +419,7 @@ static int jffs2_acl_setxattr(struct dentry *dentry, const char *name,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xattr_handler jffs2_acl_access_xattr_handler = {
|
const struct xattr_handler jffs2_acl_access_xattr_handler = {
|
||||||
.prefix = POSIX_ACL_XATTR_ACCESS,
|
.prefix = POSIX_ACL_XATTR_ACCESS,
|
||||||
.flags = ACL_TYPE_DEFAULT,
|
.flags = ACL_TYPE_DEFAULT,
|
||||||
.list = jffs2_acl_access_listxattr,
|
.list = jffs2_acl_access_listxattr,
|
||||||
|
@ -427,7 +427,7 @@ struct xattr_handler jffs2_acl_access_xattr_handler = {
|
||||||
.set = jffs2_acl_setxattr,
|
.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,
|
.prefix = POSIX_ACL_XATTR_DEFAULT,
|
||||||
.flags = ACL_TYPE_DEFAULT,
|
.flags = ACL_TYPE_DEFAULT,
|
||||||
.list = jffs2_acl_default_listxattr,
|
.list = jffs2_acl_default_listxattr,
|
||||||
|
|
|
@ -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_pre(struct inode *, struct inode *, int *);
|
||||||
extern int jffs2_init_acl_post(struct inode *);
|
extern int jffs2_init_acl_post(struct inode *);
|
||||||
|
|
||||||
extern struct xattr_handler jffs2_acl_access_xattr_handler;
|
extern const struct xattr_handler jffs2_acl_access_xattr_handler;
|
||||||
extern struct xattr_handler jffs2_acl_default_xattr_handler;
|
extern const struct xattr_handler jffs2_acl_default_xattr_handler;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ static size_t jffs2_security_listxattr(struct dentry *dentry, char *list,
|
||||||
return retlen;
|
return retlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xattr_handler jffs2_security_xattr_handler = {
|
const struct xattr_handler jffs2_security_xattr_handler = {
|
||||||
.prefix = XATTR_SECURITY_PREFIX,
|
.prefix = XATTR_SECURITY_PREFIX,
|
||||||
.list = jffs2_security_listxattr,
|
.list = jffs2_security_listxattr,
|
||||||
.set = jffs2_security_setxattr,
|
.set = jffs2_security_setxattr,
|
||||||
|
|
|
@ -904,7 +904,7 @@ struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c,
|
||||||
* do_jffs2_setxattr(inode, xprefix, xname, buffer, size, flags)
|
* do_jffs2_setxattr(inode, xprefix, xname, buffer, size, flags)
|
||||||
* is an implementation of setxattr handler on jffs2.
|
* 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,
|
&jffs2_user_xattr_handler,
|
||||||
#ifdef CONFIG_JFFS2_FS_SECURITY
|
#ifdef CONFIG_JFFS2_FS_SECURITY
|
||||||
&jffs2_security_xattr_handler,
|
&jffs2_security_xattr_handler,
|
||||||
|
@ -917,8 +917,8 @@ struct xattr_handler *jffs2_xattr_handlers[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct xattr_handler *xprefix_to_handler(int xprefix) {
|
static const struct xattr_handler *xprefix_to_handler(int xprefix) {
|
||||||
struct xattr_handler *ret;
|
const struct xattr_handler *ret;
|
||||||
|
|
||||||
switch (xprefix) {
|
switch (xprefix) {
|
||||||
case JFFS2_XPREFIX_USER:
|
case JFFS2_XPREFIX_USER:
|
||||||
|
@ -955,7 +955,7 @@ ssize_t jffs2_listxattr(struct dentry *dentry, char *buffer, size_t size)
|
||||||
struct jffs2_inode_cache *ic = f->inocache;
|
struct jffs2_inode_cache *ic = f->inocache;
|
||||||
struct jffs2_xattr_ref *ref, **pref;
|
struct jffs2_xattr_ref *ref, **pref;
|
||||||
struct jffs2_xattr_datum *xd;
|
struct jffs2_xattr_datum *xd;
|
||||||
struct xattr_handler *xhandle;
|
const struct xattr_handler *xhandle;
|
||||||
ssize_t len, rc;
|
ssize_t len, rc;
|
||||||
int retry = 0;
|
int retry = 0;
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,9 @@ extern int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname
|
||||||
extern int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
|
extern int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
|
||||||
const char *buffer, size_t size, int flags);
|
const char *buffer, size_t size, int flags);
|
||||||
|
|
||||||
extern struct xattr_handler *jffs2_xattr_handlers[];
|
extern const struct xattr_handler *jffs2_xattr_handlers[];
|
||||||
extern struct xattr_handler jffs2_user_xattr_handler;
|
extern const struct xattr_handler jffs2_user_xattr_handler;
|
||||||
extern struct xattr_handler jffs2_trusted_xattr_handler;
|
extern const struct xattr_handler jffs2_trusted_xattr_handler;
|
||||||
|
|
||||||
extern ssize_t jffs2_listxattr(struct dentry *, char *, size_t);
|
extern ssize_t jffs2_listxattr(struct dentry *, char *, size_t);
|
||||||
#define jffs2_getxattr generic_getxattr
|
#define jffs2_getxattr generic_getxattr
|
||||||
|
@ -122,7 +122,7 @@ extern ssize_t jffs2_listxattr(struct dentry *, char *, size_t);
|
||||||
|
|
||||||
#ifdef CONFIG_JFFS2_FS_SECURITY
|
#ifdef CONFIG_JFFS2_FS_SECURITY
|
||||||
extern int jffs2_init_security(struct inode *inode, struct inode *dir);
|
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
|
#else
|
||||||
#define jffs2_init_security(inode,dir) (0)
|
#define jffs2_init_security(inode,dir) (0)
|
||||||
#endif /* CONFIG_JFFS2_FS_SECURITY */
|
#endif /* CONFIG_JFFS2_FS_SECURITY */
|
||||||
|
|
|
@ -47,7 +47,7 @@ static size_t jffs2_trusted_listxattr(struct dentry *dentry, char *list,
|
||||||
return retlen;
|
return retlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xattr_handler jffs2_trusted_xattr_handler = {
|
const struct xattr_handler jffs2_trusted_xattr_handler = {
|
||||||
.prefix = XATTR_TRUSTED_PREFIX,
|
.prefix = XATTR_TRUSTED_PREFIX,
|
||||||
.list = jffs2_trusted_listxattr,
|
.list = jffs2_trusted_listxattr,
|
||||||
.set = jffs2_trusted_setxattr,
|
.set = jffs2_trusted_setxattr,
|
||||||
|
|
|
@ -47,7 +47,7 @@ static size_t jffs2_user_listxattr(struct dentry *dentry, char *list,
|
||||||
return retlen;
|
return retlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xattr_handler jffs2_user_xattr_handler = {
|
const struct xattr_handler jffs2_user_xattr_handler = {
|
||||||
.prefix = XATTR_USER_PREFIX,
|
.prefix = XATTR_USER_PREFIX,
|
||||||
.list = jffs2_user_listxattr,
|
.list = jffs2_user_listxattr,
|
||||||
.set = jffs2_user_setxattr,
|
.set = jffs2_user_setxattr,
|
||||||
|
|
Loading…
Reference in a new issue