summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr_security.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-12-02 14:44:43 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-13 19:46:12 -0500
commit764a5c6b1fa4306dd7573c1d80914254909cd036 (patch)
tree6e5ceb636c3b53cdc0994cf8c2415656e2b12e82 /fs/reiserfs/xattr_security.c
parent1046cb119521b5e1881f380dc99729fc84c96661 (diff)
downloadop-kernel-dev-764a5c6b1fa4306dd7573c1d80914254909cd036.zip
op-kernel-dev-764a5c6b1fa4306dd7573c1d80914254909cd036.tar.gz
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>
Diffstat (limited to 'fs/reiserfs/xattr_security.c')
-rw-r--r--fs/reiserfs/xattr_security.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c
index ac659af..ab0217d 100644
--- a/fs/reiserfs/xattr_security.c
+++ b/fs/reiserfs/xattr_security.c
@@ -34,21 +34,9 @@ security_set(const struct xattr_handler *handler, struct dentry *dentry,
return reiserfs_xattr_set(d_inode(dentry), name, buffer, size, flags);
}
-static size_t security_list(const struct xattr_handler *handler,
- struct dentry *dentry, char *list, size_t list_len,
- const char *name, size_t namelen)
+static bool security_list(struct dentry *dentry)
{
- const size_t len = namelen + 1;
-
- if (IS_PRIVATE(d_inode(dentry)))
- return 0;
-
- if (list && len <= list_len) {
- memcpy(list, name, namelen);
- list[namelen] = '\0';
- }
-
- return len;
+ return !IS_PRIVATE(d_inode(dentry));
}
/* Initializes the security context for a new inode and returns the number
OpenPOWER on IntegriCloud