Blame view

fs/reiserfs/xattr_user.c 1.02 KB
f466c6fdb   Al Viro   move private bits...
1
  #include "reiserfs.h"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
5
  #include <linux/errno.h>
  #include <linux/fs.h>
  #include <linux/pagemap.h>
  #include <linux/xattr.h>
c45ac8887   Al Viro   take private bits...
6
  #include "xattr.h"
17093991a   Fabian Frederick   fs/reiserfs: use ...
7
  #include <linux/uaccess.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
8

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