xattr: remove unused argument
authorChristian Brauner <brauner@kernel.org>
Wed, 1 Feb 2023 13:14:54 +0000 (14:14 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Mon, 6 Mar 2023 08:57:11 +0000 (09:57 +0100)
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>
fs/nfsd/nfs4xdr.c
fs/xattr.c
include/linux/xattr.h

index e12e5a4..e30c074 100644 (file)
@@ -3444,8 +3444,7 @@ out_acl:
                p = xdr_reserve_space(xdr, 4);
                if (!p)
                        goto out_resource;
-               err = xattr_supported_namespace(d_inode(dentry),
-                                               XATTR_USER_PREFIX);
+               err = xattr_supports_user_prefix(d_inode(dentry));
                *p++ = cpu_to_be32(err == 0);
        }
 
index 1a35235..95bb6b3 100644 (file)
@@ -160,11 +160,10 @@ xattr_permission(struct mnt_idmap *idmap, struct inode *inode,
  * Look for any handler that deals with the specified namespace.
  */
 int
-xattr_supported_namespace(struct inode *inode, const char *prefix)
+xattr_supports_user_prefix(struct inode *inode)
 {
        const struct xattr_handler **handlers = inode->i_sb->s_xattr;
        const struct xattr_handler *handler;
-       size_t preflen;
 
        if (!(inode->i_opflags & IOP_XATTR)) {
                if (unlikely(is_bad_inode(inode)))
@@ -172,16 +171,15 @@ xattr_supported_namespace(struct inode *inode, const char *prefix)
                return -EOPNOTSUPP;
        }
 
-       preflen = strlen(prefix);
-
        for_each_xattr_handler(handlers, handler) {
-               if (!strncmp(xattr_prefix(handler), prefix, preflen))
+               if (!strncmp(xattr_prefix(handler), XATTR_USER_PREFIX,
+                            XATTR_USER_PREFIX_LEN))
                        return 0;
        }
 
        return -EOPNOTSUPP;
 }
-EXPORT_SYMBOL(xattr_supported_namespace);
+EXPORT_SYMBOL(xattr_supports_user_prefix);
 
 int
 __vfs_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,
index 7adf768..d591ef5 100644 (file)
@@ -94,7 +94,7 @@ int vfs_getxattr_alloc(struct mnt_idmap *idmap,
                       struct dentry *dentry, const char *name,
                       char **xattr_value, size_t size, gfp_t flags);
 
-int xattr_supported_namespace(struct inode *inode, const char *prefix);
+int xattr_supports_user_prefix(struct inode *inode);
 
 static inline const char *xattr_prefix(const struct xattr_handler *handler)
 {