Blame view
fs/reiserfs/xattr_user.c
1.06 KB
b24413180
|
1 |
// SPDX-License-Identifier: GPL-2.0 |
f466c6fdb
|
2 |
#include "reiserfs.h" |
1da177e4c
|
3 4 5 6 |
#include <linux/errno.h> #include <linux/fs.h> #include <linux/pagemap.h> #include <linux/xattr.h> |
c45ac8887
|
7 |
#include "xattr.h" |
17093991a
|
8 |
#include <linux/uaccess.h> |
1da177e4c
|
9 |
|
1da177e4c
|
10 |
static int |
b296821a7
|
11 12 |
user_get(const struct xattr_handler *handler, struct dentry *unused, struct inode *inode, const char *name, void *buffer, size_t size) |
1da177e4c
|
13 |
{ |
b296821a7
|
14 |
if (!reiserfs_xattrs_user(inode->i_sb)) |
bd4c625c0
|
15 |
return -EOPNOTSUPP; |
b296821a7
|
16 |
return reiserfs_xattr_get(inode, xattr_full_name(handler, name), |
79a628d14
|
17 |
buffer, size); |
1da177e4c
|
18 19 20 |
} static int |
593012268
|
21 22 23 |
user_set(const struct xattr_handler *handler, struct dentry *unused, struct inode *inode, const char *name, const void *buffer, size_t size, int flags) |
1da177e4c
|
24 |
{ |
593012268
|
25 |
if (!reiserfs_xattrs_user(inode->i_sb)) |
bd4c625c0
|
26 |
return -EOPNOTSUPP; |
593012268
|
27 |
return reiserfs_xattr_set(inode, |
79a628d14
|
28 29 |
xattr_full_name(handler, name), buffer, size, flags); |
1da177e4c
|
30 |
} |
764a5c6b1
|
31 |
static bool user_list(struct dentry *dentry) |
1da177e4c
|
32 |
{ |
764a5c6b1
|
33 |
return reiserfs_xattrs_user(dentry->d_sb); |
1da177e4c
|
34 |
} |
94d09a98c
|
35 |
const struct xattr_handler reiserfs_xattr_user_handler = { |
1da177e4c
|
36 37 38 |
.prefix = XATTR_USER_PREFIX, .get = user_get, .set = user_set, |
1da177e4c
|
39 40 |
.list = user_list, }; |