Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xattr: remove unused argument

his helpers is really just used to check for user.* xattr support so
don't make it pointlessly generic.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>

+6 -9
+1 -2
fs/nfsd/nfs4xdr.c
··· 3444 3444 p = xdr_reserve_space(xdr, 4); 3445 3445 if (!p) 3446 3446 goto out_resource; 3447 - err = xattr_supported_namespace(d_inode(dentry), 3448 - XATTR_USER_PREFIX); 3447 + err = xattr_supports_user_prefix(d_inode(dentry)); 3449 3448 *p++ = cpu_to_be32(err == 0); 3450 3449 } 3451 3450
+4 -6
fs/xattr.c
··· 160 160 * Look for any handler that deals with the specified namespace. 161 161 */ 162 162 int 163 - xattr_supported_namespace(struct inode *inode, const char *prefix) 163 + xattr_supports_user_prefix(struct inode *inode) 164 164 { 165 165 const struct xattr_handler **handlers = inode->i_sb->s_xattr; 166 166 const struct xattr_handler *handler; 167 - size_t preflen; 168 167 169 168 if (!(inode->i_opflags & IOP_XATTR)) { 170 169 if (unlikely(is_bad_inode(inode))) ··· 171 172 return -EOPNOTSUPP; 172 173 } 173 174 174 - preflen = strlen(prefix); 175 - 176 175 for_each_xattr_handler(handlers, handler) { 177 - if (!strncmp(xattr_prefix(handler), prefix, preflen)) 176 + if (!strncmp(xattr_prefix(handler), XATTR_USER_PREFIX, 177 + XATTR_USER_PREFIX_LEN)) 178 178 return 0; 179 179 } 180 180 181 181 return -EOPNOTSUPP; 182 182 } 183 - EXPORT_SYMBOL(xattr_supported_namespace); 183 + EXPORT_SYMBOL(xattr_supports_user_prefix); 184 184 185 185 int 186 186 __vfs_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
+1 -1
include/linux/xattr.h
··· 94 94 struct dentry *dentry, const char *name, 95 95 char **xattr_value, size_t size, gfp_t flags); 96 96 97 - int xattr_supported_namespace(struct inode *inode, const char *prefix); 97 + int xattr_supports_user_prefix(struct inode *inode); 98 98 99 99 static inline const char *xattr_prefix(const struct xattr_handler *handler) 100 100 {