2 * linux/fs/hfsplus/xattr_user.c
4 * Vyacheslav Dubeyko <slava@dubeyko.com>
6 * Handler for user extended attributes.
11 #include "hfsplus_fs.h"
14 static int hfsplus_user_getxattr(struct dentry *dentry, const char *name,
15 void *buffer, size_t size, int type)
18 return hfsplus_getxattr(dentry, name, buffer, size,
19 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
22 static int hfsplus_user_setxattr(struct dentry *dentry, const char *name,
23 const void *buffer, size_t size, int flags, int type)
28 if (!strcmp(name, ""))
31 xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1,
35 strcpy(xattr_name, XATTR_USER_PREFIX);
36 strcpy(xattr_name + XATTR_USER_PREFIX_LEN, name);
38 res = hfsplus_setxattr(dentry, xattr_name, buffer, size, flags);
43 static size_t hfsplus_user_listxattr(struct dentry *dentry, char *list,
44 size_t list_size, const char *name, size_t name_len, int type)
47 * This method is not used.
48 * It is used hfsplus_listxattr() instead of generic_listxattr().
53 const struct xattr_handler hfsplus_xattr_user_handler = {
54 .prefix = XATTR_USER_PREFIX,
55 .list = hfsplus_user_listxattr,
56 .get = hfsplus_user_getxattr,
57 .set = hfsplus_user_setxattr,