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
)
20 if (!strcmp(name
, ""))
23 xattr_name
= kmalloc(NLS_MAX_CHARSET_SIZE
* HFSPLUS_ATTR_MAX_STRLEN
+ 1,
27 strcpy(xattr_name
, XATTR_USER_PREFIX
);
28 strcpy(xattr_name
+ XATTR_USER_PREFIX_LEN
, name
);
30 res
= hfsplus_getxattr(dentry
, xattr_name
, buffer
, size
);
35 static int hfsplus_user_setxattr(struct dentry
*dentry
, const char *name
,
36 const void *buffer
, size_t size
, int flags
, int type
)
41 if (!strcmp(name
, ""))
44 xattr_name
= kmalloc(NLS_MAX_CHARSET_SIZE
* HFSPLUS_ATTR_MAX_STRLEN
+ 1,
48 strcpy(xattr_name
, XATTR_USER_PREFIX
);
49 strcpy(xattr_name
+ XATTR_USER_PREFIX_LEN
, name
);
51 res
= hfsplus_setxattr(dentry
, xattr_name
, buffer
, size
, flags
);
56 static size_t hfsplus_user_listxattr(struct dentry
*dentry
, char *list
,
57 size_t list_size
, const char *name
, size_t name_len
, int type
)
60 * This method is not used.
61 * It is used hfsplus_listxattr() instead of generic_listxattr().
66 const struct xattr_handler hfsplus_xattr_user_handler
= {
67 .prefix
= XATTR_USER_PREFIX
,
68 .list
= hfsplus_user_listxattr
,
69 .get
= hfsplus_user_getxattr
,
70 .set
= hfsplus_user_setxattr
,