]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - fs/reiserfs/xattr_user.c
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / fs / reiserfs / xattr_user.c
CommitLineData
f466c6fd 1#include "reiserfs.h"
1da177e4
LT
2#include <linux/errno.h>
3#include <linux/fs.h>
4#include <linux/pagemap.h>
5#include <linux/xattr.h>
c45ac888 6#include "xattr.h"
17093991 7#include <linux/uaccess.h>
1da177e4 8
1da177e4 9static int
b296821a
AV
10user_get(const struct xattr_handler *handler, struct dentry *unused,
11 struct inode *inode, const char *name, void *buffer, size_t size)
1da177e4 12{
b296821a 13 if (!reiserfs_xattrs_user(inode->i_sb))
bd4c625c 14 return -EOPNOTSUPP;
b296821a 15 return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
79a628d1 16 buffer, size);
1da177e4
LT
17}
18
19static int
59301226
AV
20user_set(const struct xattr_handler *handler, struct dentry *unused,
21 struct inode *inode, const char *name, const void *buffer,
22 size_t size, int flags)
1da177e4 23{
59301226 24 if (!reiserfs_xattrs_user(inode->i_sb))
bd4c625c 25 return -EOPNOTSUPP;
59301226 26 return reiserfs_xattr_set(inode,
79a628d1
AV
27 xattr_full_name(handler, name),
28 buffer, size, flags);
1da177e4
LT
29}
30
764a5c6b 31static bool user_list(struct dentry *dentry)
1da177e4 32{
764a5c6b 33 return reiserfs_xattrs_user(dentry->d_sb);
1da177e4
LT
34}
35
94d09a98 36const struct xattr_handler reiserfs_xattr_user_handler = {
1da177e4
LT
37 .prefix = XATTR_USER_PREFIX,
38 .get = user_get,
39 .set = user_set,
1da177e4
LT
40 .list = user_list,
41};