Commit 94d09a98 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Al Viro

reiserfs: constify xattr_handler

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 11e27528
...@@ -723,11 +723,11 @@ reiserfs_xattr_get(struct inode *inode, const char *name, void *buffer, ...@@ -723,11 +723,11 @@ reiserfs_xattr_get(struct inode *inode, const char *name, void *buffer,
(handler) = *(handlers)++) (handler) = *(handlers)++)
/* This is the implementation for the xattr plugin infrastructure */ /* This is the implementation for the xattr plugin infrastructure */
static inline struct xattr_handler * static inline const struct xattr_handler *
find_xattr_handler_prefix(struct xattr_handler **handlers, find_xattr_handler_prefix(const struct xattr_handler **handlers,
const char *name) const char *name)
{ {
struct xattr_handler *xah; const struct xattr_handler *xah;
if (!handlers) if (!handlers)
return NULL; return NULL;
...@@ -748,7 +748,7 @@ ssize_t ...@@ -748,7 +748,7 @@ ssize_t
reiserfs_getxattr(struct dentry * dentry, const char *name, void *buffer, reiserfs_getxattr(struct dentry * dentry, const char *name, void *buffer,
size_t size) size_t size)
{ {
struct xattr_handler *handler; const struct xattr_handler *handler;
handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name); handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
...@@ -767,7 +767,7 @@ int ...@@ -767,7 +767,7 @@ int
reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value, reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value,
size_t size, int flags) 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); handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
...@@ -784,7 +784,7 @@ reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value, ...@@ -784,7 +784,7 @@ reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value,
*/ */
int reiserfs_removexattr(struct dentry *dentry, const char *name) 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); handler = find_xattr_handler_prefix(dentry->d_sb->s_xattr, name);
if (!handler || get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) if (!handler || get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
...@@ -807,7 +807,7 @@ static int listxattr_filler(void *buf, const char *name, int namelen, ...@@ -807,7 +807,7 @@ static int listxattr_filler(void *buf, const char *name, int namelen,
size_t size; size_t size;
if (name[0] != '.' || if (name[0] != '.' ||
(namelen != 1 && (name[1] != '.' || namelen != 2))) { (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, handler = find_xattr_handler_prefix(b->dentry->d_sb->s_xattr,
name); name);
if (!handler) /* Unsupported xattr name */ if (!handler) /* Unsupported xattr name */
...@@ -920,7 +920,7 @@ static int create_privroot(struct dentry *dentry) { return 0; } ...@@ -920,7 +920,7 @@ static int create_privroot(struct dentry *dentry) { return 0; }
#endif #endif
/* Actual operations that are exported to VFS-land */ /* 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 #ifdef CONFIG_REISERFS_FS_XATTR
&reiserfs_xattr_user_handler, &reiserfs_xattr_user_handler,
&reiserfs_xattr_trusted_handler, &reiserfs_xattr_trusted_handler,
......
...@@ -500,7 +500,7 @@ static size_t posix_acl_access_list(struct dentry *dentry, char *list, ...@@ -500,7 +500,7 @@ static size_t posix_acl_access_list(struct dentry *dentry, char *list,
return size; return size;
} }
struct xattr_handler reiserfs_posix_acl_access_handler = { const struct xattr_handler reiserfs_posix_acl_access_handler = {
.prefix = POSIX_ACL_XATTR_ACCESS, .prefix = POSIX_ACL_XATTR_ACCESS,
.flags = ACL_TYPE_ACCESS, .flags = ACL_TYPE_ACCESS,
.get = posix_acl_get, .get = posix_acl_get,
...@@ -520,7 +520,7 @@ static size_t posix_acl_default_list(struct dentry *dentry, char *list, ...@@ -520,7 +520,7 @@ static size_t posix_acl_default_list(struct dentry *dentry, char *list,
return size; return size;
} }
struct xattr_handler reiserfs_posix_acl_default_handler = { const struct xattr_handler reiserfs_posix_acl_default_handler = {
.prefix = POSIX_ACL_XATTR_DEFAULT, .prefix = POSIX_ACL_XATTR_DEFAULT,
.flags = ACL_TYPE_DEFAULT, .flags = ACL_TYPE_DEFAULT,
.get = posix_acl_get, .get = posix_acl_get,
......
...@@ -111,7 +111,7 @@ void reiserfs_security_free(struct reiserfs_security_handle *sec) ...@@ -111,7 +111,7 @@ void reiserfs_security_free(struct reiserfs_security_handle *sec)
sec->value = NULL; sec->value = NULL;
} }
struct xattr_handler reiserfs_xattr_security_handler = { const struct xattr_handler reiserfs_xattr_security_handler = {
.prefix = XATTR_SECURITY_PREFIX, .prefix = XATTR_SECURITY_PREFIX,
.get = security_get, .get = security_get,
.set = security_set, .set = security_set,
......
...@@ -48,7 +48,7 @@ static size_t trusted_list(struct dentry *dentry, char *list, size_t list_size, ...@@ -48,7 +48,7 @@ static size_t trusted_list(struct dentry *dentry, char *list, size_t list_size,
return len; return len;
} }
struct xattr_handler reiserfs_xattr_trusted_handler = { const struct xattr_handler reiserfs_xattr_trusted_handler = {
.prefix = XATTR_TRUSTED_PREFIX, .prefix = XATTR_TRUSTED_PREFIX,
.get = trusted_get, .get = trusted_get,
.set = trusted_set, .set = trusted_set,
......
...@@ -44,7 +44,7 @@ static size_t user_list(struct dentry *dentry, char *list, size_t list_size, ...@@ -44,7 +44,7 @@ static size_t user_list(struct dentry *dentry, char *list, size_t list_size,
return len; return len;
} }
struct xattr_handler reiserfs_xattr_user_handler = { const struct xattr_handler reiserfs_xattr_user_handler = {
.prefix = XATTR_USER_PREFIX, .prefix = XATTR_USER_PREFIX,
.get = user_get, .get = user_get,
.set = user_set, .set = user_set,
......
...@@ -53,8 +53,8 @@ int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, ...@@ -53,8 +53,8 @@ int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
struct inode *dir, struct dentry *dentry, struct inode *dir, struct dentry *dentry,
struct inode *inode); struct inode *inode);
int reiserfs_cache_default_acl(struct inode *dir); int reiserfs_cache_default_acl(struct inode *dir);
extern struct xattr_handler reiserfs_posix_acl_default_handler; extern const 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_access_handler;
#else #else
......
...@@ -58,9 +58,9 @@ int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *, ...@@ -58,9 +58,9 @@ int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *,
struct inode *, const char *, const void *, struct inode *, const char *, const void *,
size_t, int); size_t, int);
extern struct xattr_handler reiserfs_xattr_user_handler; extern const struct xattr_handler reiserfs_xattr_user_handler;
extern struct xattr_handler reiserfs_xattr_trusted_handler; extern const struct xattr_handler reiserfs_xattr_trusted_handler;
extern struct xattr_handler reiserfs_xattr_security_handler; extern const struct xattr_handler reiserfs_xattr_security_handler;
#ifdef CONFIG_REISERFS_FS_SECURITY #ifdef CONFIG_REISERFS_FS_SECURITY
int reiserfs_security_init(struct inode *dir, struct inode *inode, int reiserfs_security_init(struct inode *dir, struct inode *inode,
struct reiserfs_security_handle *sec); struct reiserfs_security_handle *sec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment