1 #include <linux/reiserfs_fs.h>
2 #include <linux/errno.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."
12 security_get (struct inode
*inode
, const char *name
, void *buffer
, size_t size
)
14 if (strlen(name
) < sizeof(XATTR_SECURITY_PREFIX
))
17 if (is_reiserfs_priv_object(inode
))
20 return reiserfs_xattr_get (inode
, name
, buffer
, size
);
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
))
30 if (is_reiserfs_priv_object(inode
))
33 return reiserfs_xattr_set (inode
, name
, buffer
, size
, flags
);
37 security_del (struct inode
*inode
, const char *name
)
39 if (strlen(name
) < sizeof(XATTR_SECURITY_PREFIX
))
42 if (is_reiserfs_priv_object(inode
))
49 security_list (struct inode
*inode
, const char *name
, int namelen
, char *out
)
53 if (is_reiserfs_priv_object(inode
))
57 memcpy (out
, name
, len
);
63 struct reiserfs_xattr_handler security_handler
= {
64 .prefix
= XATTR_SECURITY_PREFIX
,
68 .list
= security_list
,