Blame view

fs/reiserfs/xattr_user.c 1.06 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  // SPDX-License-Identifier: GPL-2.0
f466c6fdb   Al Viro   move private bits...
2
  #include "reiserfs.h"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
4
5
6
  #include <linux/errno.h>
  #include <linux/fs.h>
  #include <linux/pagemap.h>
  #include <linux/xattr.h>
c45ac8887   Al Viro   take private bits...
7
  #include "xattr.h"
17093991a   Fabian Frederick   fs/reiserfs: use ...
8
  #include <linux/uaccess.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
  static int
b296821a7   Al Viro   xattr_handler: pa...
11
12
  user_get(const struct xattr_handler *handler, struct dentry *unused,
  	 struct inode *inode, const char *name, void *buffer, size_t size)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
  {
b296821a7   Al Viro   xattr_handler: pa...
14
  	if (!reiserfs_xattrs_user(inode->i_sb))
bd4c625c0   Linus Torvalds   reiserfs: run scr...
15
  		return -EOPNOTSUPP;
b296821a7   Al Viro   xattr_handler: pa...
16
  	return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
79a628d14   Al Viro   reiserfs: switch ...
17
  				  buffer, size);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18
19
20
  }
  
  static int
593012268   Al Viro   switch xattr_hand...
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   Linus Torvalds   Linux-2.6.12-rc2
24
  {
593012268   Al Viro   switch xattr_hand...
25
  	if (!reiserfs_xattrs_user(inode->i_sb))
bd4c625c0   Linus Torvalds   reiserfs: run scr...
26
  		return -EOPNOTSUPP;
593012268   Al Viro   switch xattr_hand...
27
  	return reiserfs_xattr_set(inode,
79a628d14   Al Viro   reiserfs: switch ...
28
29
  				  xattr_full_name(handler, name),
  				  buffer, size, flags);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
  }
764a5c6b1   Andreas Gruenbacher   xattr handlers: S...
31
  static bool user_list(struct dentry *dentry)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
32
  {
764a5c6b1   Andreas Gruenbacher   xattr handlers: S...
33
  	return reiserfs_xattrs_user(dentry->d_sb);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
34
  }
94d09a98c   Stephen Hemminger   reiserfs: constif...
35
  const struct xattr_handler reiserfs_xattr_user_handler = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
36
37
38
  	.prefix = XATTR_USER_PREFIX,
  	.get = user_get,
  	.set = user_set,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
39
40
  	.list = user_list,
  };