diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 12:29:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 12:33:01 -0700 |
commit | e1c502482853f84606928f5a2f2eb6da1993cda1 (patch) | |
tree | ca296007164906342a195bdf3a5305277e6af5da /fs/reiserfs/xattr_user.c | |
parent | 019abbc87025a030fd25008612afd4eff8a375f7 (diff) | |
parent | ee93961be1faddf9e9a638bc519145c20f0cfeba (diff) | |
download | linux-e1c502482853f84606928f5a2f2eb6da1993cda1.tar.gz |
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 @@ #include <linux/reiserfs_xattr.h> #include <asm/uaccess.h> -#ifdef CONFIG_REISERFS_FS_POSIX_ACL -# include <linux/reiserfs_acl.h> -#endif - static int user_get(struct inode *inode, const char *name, void *buffer, size_t size) { @@ -25,7 +21,6 @@ static int user_set(struct inode *inode, const char *name, const void *buffer, size_t size, int flags) { - if (strlen(name) < sizeof(XATTR_USER_PREFIX)) return -EINVAL; @@ -34,33 +29,23 @@ user_set(struct inode *inode, const char *name, const void *buffer, return reiserfs_xattr_set(inode, name, buffer, size, flags); } -static int user_del(struct inode *inode, const char *name) +static size_t user_list(struct inode *inode, char *list, size_t list_size, + const char *name, size_t name_len) { - if (strlen(name) < sizeof(XATTR_USER_PREFIX)) - return -EINVAL; - - if (!reiserfs_xattrs_user(inode->i_sb)) - return -EOPNOTSUPP; - return 0; -} + const size_t len = name_len + 1; -static int -user_list(struct inode *inode, const char *name, int namelen, char *out) -{ - int len = namelen; if (!reiserfs_xattrs_user(inode->i_sb)) return 0; - - if (out) - memcpy(out, name, len); - + if (list && len <= list_size) { + memcpy(list, name, name_len); + list[name_len] = '\0'; + } return len; } -struct reiserfs_xattr_handler user_handler = { +struct xattr_handler reiserfs_xattr_user_handler = { .prefix = XATTR_USER_PREFIX, .get = user_get, .set = user_set, - .del = user_del, .list = user_list, }; |