diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:29:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:33:01 -0400 |
commit | e1c502482853f84606928f5a2f2eb6da1993cda1 (patch) | |
tree | ca296007164906342a195bdf3a5305277e6af5da /fs/reiserfs/xattr_user.c | |
parent | 019abbc87025a030fd25008612afd4eff8a375f7 (diff) | |
parent | ee93961be1faddf9e9a638bc519145c20f0cfeba (diff) |
Merge branch 'reiserfs-updates' from Jeff Mahoney
* reiserfs-updates: (35 commits)
reiserfs: rename [cn]_* variables
reiserfs: rename p_._ variables
reiserfs: rename p_s_tb to tb
reiserfs: rename p_s_inode to inode
reiserfs: rename p_s_bh to bh
reiserfs: rename p_s_sb to sb
reiserfs: strip trailing whitespace
reiserfs: cleanup path functions
reiserfs: factor out buffer_info initialization
reiserfs: add atomic addition of selinux attributes during inode creation
reiserfs: use generic readdir for operations across all xattrs
reiserfs: journaled xattrs
reiserfs: use generic xattr handlers
reiserfs: remove i_has_xattr_dir
reiserfs: make per-inode xattr locking more fine grained
reiserfs: eliminate per-super xattr lock
reiserfs: simplify xattr internal file lookups/opens
reiserfs: Clean up xattrs when REISERFS_FS_XATTR is unset
reiserfs: remove IS_PRIVATE helpers
reiserfs: remove link detection code
...
Fixed up conflicts manually due to:
- quota name cleanups vs variable naming changes:
fs/reiserfs/inode.c
fs/reiserfs/namei.c
fs/reiserfs/stree.c
fs/reiserfs/xattr.c
- exported include header cleanups
include/linux/reiserfs_fs.h
Diffstat (limited to 'fs/reiserfs/xattr_user.c')
-rw-r--r-- | fs/reiserfs/xattr_user.c | 31 |
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 | |||
13 | static int | 9 | static int |
14 | user_get(struct inode *inode, const char *name, void *buffer, size_t size) | 10 | user_get(struct inode *inode, const char *name, void *buffer, size_t size) |
15 | { | 11 | { |
@@ -25,7 +21,6 @@ static int | |||
25 | user_set(struct inode *inode, const char *name, const void *buffer, | 21 | user_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 | ||
37 | static int user_del(struct inode *inode, const char *name) | 32 | static 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 | ||
47 | static int | ||
48 | user_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 | ||
60 | struct reiserfs_xattr_handler user_handler = { | 46 | struct 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 | }; |