aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/xattr_user.c')
-rw-r--r--fs/reiserfs/xattr_user.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c
index 1384efcb938e..e3238dc4f3db 100644
--- a/fs/reiserfs/xattr_user.c
+++ b/fs/reiserfs/xattr_user.c
@@ -6,10 +6,6 @@
6#include <linux/reiserfs_xattr.h> 6#include <linux/reiserfs_xattr.h>
7#include <asm/uaccess.h> 7#include <asm/uaccess.h>
8 8
9#ifdef CONFIG_REISERFS_FS_POSIX_ACL
10# include <linux/reiserfs_acl.h>
11#endif
12
13static int 9static int
14user_get(struct inode *inode, const char *name, void *buffer, size_t size) 10user_get(struct inode *inode, const char *name, void *buffer, size_t size)
15{ 11{
@@ -25,7 +21,6 @@ static int
25user_set(struct inode *inode, const char *name, const void *buffer, 21user_set(struct inode *inode, const char *name, const void *buffer,
26 size_t size, int flags) 22 size_t size, int flags)
27{ 23{
28
29 if (strlen(name) < sizeof(XATTR_USER_PREFIX)) 24 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
30 return -EINVAL; 25 return -EINVAL;
31 26
@@ -34,33 +29,23 @@ user_set(struct inode *inode, const char *name, const void *buffer,
34 return reiserfs_xattr_set(inode, name, buffer, size, flags); 29 return reiserfs_xattr_set(inode, name, buffer, size, flags);
35} 30}
36 31
37static int user_del(struct inode *inode, const char *name) 32static size_t user_list(struct inode *inode, char *list, size_t list_size,
33 const char *name, size_t name_len)
38{ 34{
39 if (strlen(name) < sizeof(XATTR_USER_PREFIX)) 35 const size_t len = name_len + 1;
40 return -EINVAL;
41
42 if (!reiserfs_xattrs_user(inode->i_sb))
43 return -EOPNOTSUPP;
44 return 0;
45}
46 36
47static int
48user_list(struct inode *inode, const char *name, int namelen, char *out)
49{
50 int len = namelen;
51 if (!reiserfs_xattrs_user(inode->i_sb)) 37 if (!reiserfs_xattrs_user(inode->i_sb))
52 return 0; 38 return 0;
53 39 if (list && len <= list_size) {
54 if (out) 40 memcpy(list, name, name_len);
55 memcpy(out, name, len); 41 list[name_len] = '\0';
56 42 }
57 return len; 43 return len;
58} 44}
59 45
60struct reiserfs_xattr_handler user_handler = { 46struct xattr_handler reiserfs_xattr_user_handler = {
61 .prefix = XATTR_USER_PREFIX, 47 .prefix = XATTR_USER_PREFIX,
62 .get = user_get, 48 .get = user_get,
63 .set = user_set, 49 .set = user_set,
64 .del = user_del,
65 .list = user_list, 50 .list = user_list,
66}; 51};