Commit 443bfb9d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Make inode_ops->setxattr value parameter const

Patch from Andreas Gruenbacher <agruen@suse.de>

The setxattr inode operation is defined like this in 2.4 and 2.5:

        int (*setxattr) (struct dentry *dentry, const char *name,
                         void *value, size_t size, int flags);

the original type of the value parameter was `const void *'; the const
obviously has been lost at some point. The definition should be:

        int (*setxattr) (struct dentry *dentry, const char *name,
                         const void *value, size_t size, int flags);
parent 67d9df19
......@@ -230,7 +230,7 @@ ext2_listxattr(struct dentry *dentry, char *buffer, size_t size)
*/
int
ext2_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags)
const void *value, size_t size, int flags)
{
struct ext2_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
......
......@@ -67,7 +67,7 @@ struct ext2_xattr_handler {
extern int ext2_xattr_register(int, struct ext2_xattr_handler *);
extern void ext2_xattr_unregister(int, struct ext2_xattr_handler *);
extern int ext2_setxattr(struct dentry *, const char *, void *, size_t, int);
extern int ext2_setxattr(struct dentry *, const char *, const void *, size_t, int);
extern ssize_t ext2_getxattr(struct dentry *, const char *, void *, size_t);
extern ssize_t ext2_listxattr(struct dentry *, char *, size_t);
extern int ext2_removexattr(struct dentry *, const char *);
......
......@@ -223,7 +223,7 @@ ext3_listxattr(struct dentry *dentry, char *buffer, size_t size)
*/
int
ext3_setxattr(struct dentry *dentry, const char *name,
void *value, size_t size, int flags)
const void *value, size_t size, int flags)
{
struct ext3_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
......
......@@ -66,7 +66,7 @@ struct ext3_xattr_handler {
extern int ext3_xattr_register(int, struct ext3_xattr_handler *);
extern void ext3_xattr_unregister(int, struct ext3_xattr_handler *);
extern int ext3_setxattr(struct dentry *, const char *, void *, size_t, int);
extern int ext3_setxattr(struct dentry *, const char *, const void *, size_t, int);
extern ssize_t ext3_getxattr(struct dentry *, const char *, void *, size_t);
extern ssize_t ext3_listxattr(struct dentry *, char *, size_t);
extern int ext3_removexattr(struct dentry *, const char *);
......
......@@ -52,9 +52,9 @@ struct jfs_ea_list {
#define END_EALIST(ealist) \
((struct jfs_ea *) (((char *) (ealist)) + EALIST_SIZE(ealist)))
extern int __jfs_setxattr(struct inode *, const char *, void *, size_t,
extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t,
int);
extern int jfs_setxattr(struct dentry *, const char *, void *, size_t,
extern int jfs_setxattr(struct dentry *, const char *, const void *, size_t,
int);
extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t);
......
......@@ -706,7 +706,7 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
}
static int can_set_xattr(struct inode *inode, const char *name,
void *value, size_t value_len)
const void *value, size_t value_len)
{
if (IS_RDONLY(inode))
return -EROFS;
......@@ -735,7 +735,7 @@ static int can_set_xattr(struct inode *inode, const char *name,
#endif
}
int __jfs_setxattr(struct inode *inode, const char *name, void *value,
int __jfs_setxattr(struct inode *inode, const char *name, const void *value,
size_t value_len, int flags)
{
struct jfs_ea_list *ealist;
......@@ -874,7 +874,7 @@ int __jfs_setxattr(struct inode *inode, const char *name, void *value,
return rc;
}
int jfs_setxattr(struct dentry *dentry, const char *name, void *value,
int jfs_setxattr(struct dentry *dentry, const char *name, const void *value,
size_t value_len, int flags)
{
if (value == NULL) { /* empty EA, do not remove */
......
......@@ -781,7 +781,7 @@ struct inode_operations {
int (*permission) (struct inode *, int);
int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
int (*setxattr) (struct dentry *, const char *, void *, size_t, int);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
int (*removexattr) (struct dentry *, const char *);
......
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