Make inode_ops->setxattr value parameter const Add `const' to the value parameter definition of the setxattr inode operation and fix the resulting warnings in fs/jfs/xattr.c: File systems are not supposed to modify the value. Also fixes the non-const usage in jfs. --- linux-2.4.20-rc2.patch/include/linux/fs.h~xattr-const 2002-11-18 23:51:35.000000000 +0100 +++ linux-2.4.20-rc2.patch-agruen/include/linux/fs.h 2002-11-18 23:51:35.000000000 +0100 @@ -866,7 +866,7 @@ int (*revalidate) (struct dentry *); int (*setattr) (struct dentry *, struct iattr *); int (*getattr) (struct dentry *, struct iattr *); - 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 *); --- linux-2.4.20-rc2.patch/fs/jfs/xattr.c~xattr-const 2002-11-18 23:51:35.000000000 +0100 +++ linux-2.4.20-rc2.patch-agruen/fs/jfs/xattr.c 2002-11-18 23:51:35.000000000 +0100 @@ -641,7 +641,7 @@ } 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; @@ -660,7 +660,7 @@ return permission(inode, MAY_WRITE); } -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; @@ -799,7 +799,7 @@ 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 */ --- linux-2.4.20-rc2.patch/fs/jfs/jfs_xattr.h~xattr-const 2002-11-18 23:52:56.000000000 +0100 +++ linux-2.4.20-rc2.patch-agruen/fs/jfs/jfs_xattr.h 2002-11-18 23:40:27.000000000 +0100 @@ -52,8 +52,10 @@ #define END_EALIST(ealist) \ ((struct jfs_ea *) (((char *) (ealist)) + EALIST_SIZE(ealist))) -extern int __jfs_setxattr(struct inode *, const char *, void *, size_t, int); -extern int jfs_setxattr(struct dentry *, const char *, void *, size_t, int); +extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t, + int); +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); extern ssize_t jfs_listxattr(struct dentry *, char *, size_t); _