From e409de992e3ea3674393465f07cc71c948edd87a Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sun, 4 Oct 2015 19:18:52 +0200 Subject: 9p: xattr simplifications Now that the xattr handler is passed to the xattr handler operations, we can use the same get and set operations for the user, trusted, and security xattr namespaces. In those namespaces, we can access the full attribute name by "reattaching" the name prefix the vfs has skipped for us. Add a xattr_full_name helper to make this obvious in the code. For the "system.posix_acl_access" and "system.posix_acl_default" attributes, handler->prefix is the full attribute name; the suffix is the empty string. Signed-off-by: Andreas Gruenbacher Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Cc: v9fs-developer@lists.sourceforge.net Signed-off-by: Al Viro --- include/linux/xattr.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 91b0a68d38dc..89474b9d260c 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -21,15 +21,19 @@ struct dentry; struct xattr_handler { const char *prefix; - int flags; /* fs private flags passed back to the handlers */ - size_t (*list)(struct dentry *dentry, char *list, size_t list_size, - const char *name, size_t name_len, int handler_flags); - int (*get)(struct dentry *dentry, const char *name, void *buffer, - size_t size, int handler_flags); - int (*set)(struct dentry *dentry, const char *name, const void *buffer, - size_t size, int flags, int handler_flags); + int flags; /* fs private flags */ + size_t (*list)(const struct xattr_handler *, struct dentry *dentry, + char *list, size_t list_size, const char *name, + size_t name_len); + int (*get)(const struct xattr_handler *, struct dentry *dentry, + const char *name, void *buffer, size_t size); + int (*set)(const struct xattr_handler *, struct dentry *dentry, + const char *name, const void *buffer, size_t size, + int flags); }; +const char *xattr_full_name(const struct xattr_handler *, const char *); + struct xattr { const char *name; void *value; -- cgit