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