aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/xattr_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus/xattr_user.c')
-rw-r--r--fs/hfsplus/xattr_user.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/fs/hfsplus/xattr_user.c b/fs/hfsplus/xattr_user.c
index 2b625a538b64..5aa0e6dc4a1e 100644
--- a/fs/hfsplus/xattr_user.c
+++ b/fs/hfsplus/xattr_user.c
@@ -14,43 +14,16 @@
14static int hfsplus_user_getxattr(struct dentry *dentry, const char *name, 14static int hfsplus_user_getxattr(struct dentry *dentry, const char *name,
15 void *buffer, size_t size, int type) 15 void *buffer, size_t size, int type)
16{ 16{
17 char *xattr_name;
18 int res;
19 17
20 if (!strcmp(name, "")) 18 return hfsplus_getxattr(dentry, name, buffer, size,
21 return -EINVAL; 19 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
22
23 xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1,
24 GFP_KERNEL);
25 if (!xattr_name)
26 return -ENOMEM;
27 strcpy(xattr_name, XATTR_USER_PREFIX);
28 strcpy(xattr_name + XATTR_USER_PREFIX_LEN, name);
29
30 res = hfsplus_getxattr(dentry, xattr_name, buffer, size);
31 kfree(xattr_name);
32 return res;
33} 20}
34 21
35static int hfsplus_user_setxattr(struct dentry *dentry, const char *name, 22static int hfsplus_user_setxattr(struct dentry *dentry, const char *name,
36 const void *buffer, size_t size, int flags, int type) 23 const void *buffer, size_t size, int flags, int type)
37{ 24{
38 char *xattr_name; 25 return hfsplus_setxattr(dentry, name, buffer, size, flags,
39 int res; 26 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
40
41 if (!strcmp(name, ""))
42 return -EINVAL;
43
44 xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1,
45 GFP_KERNEL);
46 if (!xattr_name)
47 return -ENOMEM;
48 strcpy(xattr_name, XATTR_USER_PREFIX);
49 strcpy(xattr_name + XATTR_USER_PREFIX_LEN, name);
50
51 res = hfsplus_setxattr(dentry, xattr_name, buffer, size, flags);
52 kfree(xattr_name);
53 return res;
54} 27}
55 28
56static size_t hfsplus_user_listxattr(struct dentry *dentry, char *list, 29static size_t hfsplus_user_listxattr(struct dentry *dentry, char *list,