irq: remove >= nr_irqs checking with config_have_sparse_irq
[deliverable/linux.git] / fs / reiserfs / xattr_user.c
CommitLineData
1da177e4
LT
1#include <linux/reiserfs_fs.h>
2#include <linux/errno.h>
3#include <linux/fs.h>
4#include <linux/pagemap.h>
5#include <linux/xattr.h>
6#include <linux/reiserfs_xattr.h>
7#include <asm/uaccess.h>
8
9#ifdef CONFIG_REISERFS_FS_POSIX_ACL
10# include <linux/reiserfs_acl.h>
11#endif
12
1da177e4 13static int
bd4c625c 14user_get(struct inode *inode, const char *name, void *buffer, size_t size)
1da177e4
LT
15{
16
bd4c625c
LT
17 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
18 return -EINVAL;
bd4c625c
LT
19 if (!reiserfs_xattrs_user(inode->i_sb))
20 return -EOPNOTSUPP;
bd4c625c 21 return reiserfs_xattr_get(inode, name, buffer, size);
1da177e4
LT
22}
23
24static int
bd4c625c
LT
25user_set(struct inode *inode, const char *name, const void *buffer,
26 size_t size, int flags)
1da177e4
LT
27{
28
bd4c625c
LT
29 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
30 return -EINVAL;
1da177e4 31
bd4c625c
LT
32 if (!reiserfs_xattrs_user(inode->i_sb))
33 return -EOPNOTSUPP;
bd4c625c 34 return reiserfs_xattr_set(inode, name, buffer, size, flags);
1da177e4
LT
35}
36
bd4c625c 37static int user_del(struct inode *inode, const char *name)
1da177e4 38{
bd4c625c
LT
39 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
40 return -EINVAL;
1da177e4 41
bd4c625c
LT
42 if (!reiserfs_xattrs_user(inode->i_sb))
43 return -EOPNOTSUPP;
bd4c625c 44 return 0;
1da177e4
LT
45}
46
47static int
bd4c625c 48user_list(struct inode *inode, const char *name, int namelen, char *out)
1da177e4 49{
bd4c625c
LT
50 int len = namelen;
51 if (!reiserfs_xattrs_user(inode->i_sb))
52 return 0;
1da177e4 53
bd4c625c
LT
54 if (out)
55 memcpy(out, name, len);
1da177e4 56
bd4c625c 57 return len;
1da177e4
LT
58}
59
60struct reiserfs_xattr_handler user_handler = {
61 .prefix = XATTR_USER_PREFIX,
62 .get = user_get,
63 .set = user_set,
64 .del = user_del,
65 .list = user_list,
66};
This page took 0.392688 seconds and 5 git commands to generate.