xattr handlers: Simplify list operation

Change the list operation to only return whether or not an attribute
should be listed.  Copying the attribute names into the buffer is moved
to the callers.

Since the result only depends on the dentry and not on the attribute
name, we do not pass the attribute name to list operations.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Andreas Gruenbacher
2015-12-02 14:44:43 +01:00
committed by Al Viro
父節點 1046cb1195
當前提交 764a5c6b1f
共有 22 個文件被更改,包括 113 次插入335 次删除

查看文件

@@ -823,21 +823,10 @@ out:
return ret;
}
static size_t
posix_acl_xattr_list(const struct xattr_handler *handler,
struct dentry *dentry, char *list, size_t list_size,
const char *name, size_t name_len)
static bool
posix_acl_xattr_list(struct dentry *dentry)
{
const char *xname = handler->name;
size_t size;
if (!IS_POSIXACL(d_backing_inode(dentry)))
return 0;
size = strlen(xname) + 1;
if (list && size <= list_size)
memcpy(list, xname, size);
return size;
return IS_POSIXACL(d_backing_inode(dentry));
}
const struct xattr_handler posix_acl_access_xattr_handler = {