@@ -7128,20 +7128,19 @@ static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry)
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
-static int nfs4_xattr_set_nfs4_label(const struct xattr_handler *handler,
- struct dentry *unused, struct inode *inode,
- const char *key, const void *buf,
- size_t buflen, int flags)
+static int nfs4_xattr_set_security(const struct xattr_handler *handler,
+ struct dentry *unused, struct inode *inode,
+ const char *key, const void *buf,
+ size_t buflen, int flags)
{
if (security_ismaclabel(key))
return nfs4_set_security_label(inode, buf, buflen);
-
return -EOPNOTSUPP;
}
-static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler,
- struct dentry *unused, struct inode *inode,
- const char *key, void *buf, size_t buflen)
+static int nfs4_xattr_get_security(const struct xattr_handler *handler,
+ struct dentry *unused, struct inode *inode,
+ const char *key, void *buf, size_t buflen)
{
if (security_ismaclabel(key))
return nfs4_get_security_label(inode, buf, buflen);
@@ -7161,10 +7160,10 @@ static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler,
return len;
}
-static const struct xattr_handler nfs4_xattr_nfs4_label_handler = {
+static const struct xattr_handler nfs4_xattr_security_handler = {
.prefix = XATTR_SECURITY_PREFIX,
- .get = nfs4_xattr_get_nfs4_label,
- .set = nfs4_xattr_set_nfs4_label,
+ .get = nfs4_xattr_get_security,
+ .set = nfs4_xattr_set_security,
};
#else
@@ -9824,7 +9823,7 @@ static ssize_t nfs4_listxattr(struct dentry *dentry, char *list, size_t size)
const struct xattr_handler *nfs4_xattr_handlers[] = {
&nfs4_xattr_nfs4_acl_handler,
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
- &nfs4_xattr_nfs4_label_handler,
+ &nfs4_xattr_security_handler,
#endif
NULL
};
Refactor: In a moment, the handler will no longer deal with only NFSv4 security labels. Give it a more generic name. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- fs/nfs/nfs4proc.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)