Skip to content

Commit 831be97

Browse files
committed
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 <[email protected]> Signed-off-by: Christian Brauner (Microsoft) <[email protected]>
1 parent 2db8a94 commit 831be97

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,8 +3444,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
34443444
p = xdr_reserve_space(xdr, 4);
34453445
if (!p)
34463446
goto out_resource;
3447-
err = xattr_supported_namespace(d_inode(dentry),
3448-
XATTR_USER_PREFIX);
3447+
err = xattr_supports_user_prefix(d_inode(dentry));
34493448
*p++ = cpu_to_be32(err == 0);
34503449
}
34513450

fs/xattr.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,28 +160,26 @@ xattr_permission(struct mnt_idmap *idmap, struct inode *inode,
160160
* Look for any handler that deals with the specified namespace.
161161
*/
162162
int
163-
xattr_supported_namespace(struct inode *inode, const char *prefix)
163+
xattr_supports_user_prefix(struct inode *inode)
164164
{
165165
const struct xattr_handler **handlers = inode->i_sb->s_xattr;
166166
const struct xattr_handler *handler;
167-
size_t preflen;
168167

169168
if (!(inode->i_opflags & IOP_XATTR)) {
170169
if (unlikely(is_bad_inode(inode)))
171170
return -EIO;
172171
return -EOPNOTSUPP;
173172
}
174173

175-
preflen = strlen(prefix);
176-
177174
for_each_xattr_handler(handlers, handler) {
178-
if (!strncmp(xattr_prefix(handler), prefix, preflen))
175+
if (!strncmp(xattr_prefix(handler), XATTR_USER_PREFIX,
176+
XATTR_USER_PREFIX_LEN))
179177
return 0;
180178
}
181179

182180
return -EOPNOTSUPP;
183181
}
184-
EXPORT_SYMBOL(xattr_supported_namespace);
182+
EXPORT_SYMBOL(xattr_supports_user_prefix);
185183

186184
int
187185
__vfs_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,

include/linux/xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int vfs_getxattr_alloc(struct mnt_idmap *idmap,
9494
struct dentry *dentry, const char *name,
9595
char **xattr_value, size_t size, gfp_t flags);
9696

97-
int xattr_supported_namespace(struct inode *inode, const char *prefix);
97+
int xattr_supports_user_prefix(struct inode *inode);
9898

9999
static inline const char *xattr_prefix(const struct xattr_handler *handler)
100100
{

0 commit comments

Comments
 (0)