[TG3]: Set minimal hw interrupt mitigation.
[linux-2.6/verdex.git] / fs / reiserfs / xattr_security.c
blobe044d5117117f46eab4179308ee3c6d212e05ddf
1 #include <linux/reiserfs_fs.h>
2 #include <linux/errno.h>
3 #include <linux/fs.h>
4 #include <linux/pagemap.h>
5 #include <linux/xattr.h>
6 #include <linux/reiserfs_xattr.h>
7 #include <asm/uaccess.h>
9 #define XATTR_SECURITY_PREFIX "security."
11 static int
12 security_get (struct inode *inode, const char *name, void *buffer, size_t size)
14 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
15 return -EINVAL;
17 if (is_reiserfs_priv_object(inode))
18 return -EPERM;
20 return reiserfs_xattr_get (inode, name, buffer, size);
23 static int
24 security_set (struct inode *inode, const char *name, const void *buffer,
25 size_t size, int flags)
27 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
28 return -EINVAL;
30 if (is_reiserfs_priv_object(inode))
31 return -EPERM;
33 return reiserfs_xattr_set (inode, name, buffer, size, flags);
36 static int
37 security_del (struct inode *inode, const char *name)
39 if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
40 return -EINVAL;
42 if (is_reiserfs_priv_object(inode))
43 return -EPERM;
45 return 0;
48 static int
49 security_list (struct inode *inode, const char *name, int namelen, char *out)
51 int len = namelen;
53 if (is_reiserfs_priv_object(inode))
54 return 0;
56 if (out)
57 memcpy (out, name, len);
59 return len;
63 struct reiserfs_xattr_handler security_handler = {
64 .prefix = XATTR_SECURITY_PREFIX,
65 .get = security_get,
66 .set = security_set,
67 .del = security_del,
68 .list = security_list,