Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at bf2b3de2a8e66e5f554c2113fac688bcaaca77fb 142 lines 4.2 kB view raw
1/* 2 File: linux/reiserfs_xattr.h 3*/ 4 5#include <linux/xattr.h> 6 7/* Magic value in header */ 8#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 9 10struct reiserfs_xattr_header { 11 __le32 h_magic; /* magic number for identification */ 12 __le32 h_hash; /* hash of the value */ 13}; 14 15#ifdef __KERNEL__ 16#include <linux/init.h> 17 18struct reiserfs_xattr_handler { 19 char *prefix; 20 int (*init) (void); 21 void (*exit) (void); 22 int (*get) (struct inode * inode, const char *name, void *buffer, 23 size_t size); 24 int (*set) (struct inode * inode, const char *name, const void *buffer, 25 size_t size, int flags); 26 int (*del) (struct inode * inode, const char *name); 27 int (*list) (struct inode * inode, const char *name, int namelen, 28 char *out); 29 struct list_head handlers; 30}; 31 32#ifdef CONFIG_REISERFS_FS_XATTR 33#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode) 34#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 35ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, 36 void *buffer, size_t size); 37int reiserfs_setxattr(struct dentry *dentry, const char *name, 38 const void *value, size_t size, int flags); 39ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 40int reiserfs_removexattr(struct dentry *dentry, const char *name); 41int reiserfs_delete_xattrs(struct inode *inode); 42int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); 43int reiserfs_xattr_init(struct super_block *sb, int mount_flags); 44int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd); 45 46int reiserfs_xattr_del(struct inode *, const char *); 47int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t); 48int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); 49 50extern struct reiserfs_xattr_handler user_handler; 51extern struct reiserfs_xattr_handler trusted_handler; 52#ifdef CONFIG_REISERFS_FS_SECURITY 53extern struct reiserfs_xattr_handler security_handler; 54#endif 55 56int reiserfs_xattr_register_handlers(void) __init; 57void reiserfs_xattr_unregister_handlers(void); 58 59static inline void reiserfs_write_lock_xattrs(struct super_block *sb) 60{ 61 down_write(&REISERFS_XATTR_DIR_SEM(sb)); 62} 63static inline void reiserfs_write_unlock_xattrs(struct super_block *sb) 64{ 65 up_write(&REISERFS_XATTR_DIR_SEM(sb)); 66} 67static inline void reiserfs_read_lock_xattrs(struct super_block *sb) 68{ 69 down_read(&REISERFS_XATTR_DIR_SEM(sb)); 70} 71 72static inline void reiserfs_read_unlock_xattrs(struct super_block *sb) 73{ 74 up_read(&REISERFS_XATTR_DIR_SEM(sb)); 75} 76 77static inline void reiserfs_write_lock_xattr_i(struct inode *inode) 78{ 79 down_write(&REISERFS_I(inode)->xattr_sem); 80} 81static inline void reiserfs_write_unlock_xattr_i(struct inode *inode) 82{ 83 up_write(&REISERFS_I(inode)->xattr_sem); 84} 85static inline void reiserfs_read_lock_xattr_i(struct inode *inode) 86{ 87 down_read(&REISERFS_I(inode)->xattr_sem); 88} 89 90static inline void reiserfs_read_unlock_xattr_i(struct inode *inode) 91{ 92 up_read(&REISERFS_I(inode)->xattr_sem); 93} 94 95static inline void reiserfs_mark_inode_private(struct inode *inode) 96{ 97 inode->i_flags |= S_PRIVATE; 98} 99 100static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 101{ 102 init_rwsem(&REISERFS_I(inode)->xattr_sem); 103} 104 105#else 106 107#define is_reiserfs_priv_object(inode) 0 108#define reiserfs_mark_inode_private(inode) do {;} while(0) 109#define reiserfs_getxattr NULL 110#define reiserfs_setxattr NULL 111#define reiserfs_listxattr NULL 112#define reiserfs_removexattr NULL 113#define reiserfs_write_lock_xattrs(sb) do {;} while(0) 114#define reiserfs_write_unlock_xattrs(sb) do {;} while(0) 115#define reiserfs_read_lock_xattrs(sb) 116#define reiserfs_read_unlock_xattrs(sb) 117 118#define reiserfs_permission NULL 119 120#define reiserfs_xattr_register_handlers() 0 121#define reiserfs_xattr_unregister_handlers() 122 123static inline int reiserfs_delete_xattrs(struct inode *inode) 124{ 125 return 0; 126}; 127static inline int reiserfs_chown_xattrs(struct inode *inode, 128 struct iattr *attrs) 129{ 130 return 0; 131}; 132static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags) 133{ 134 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ 135 return 0; 136}; 137static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 138{ 139} 140#endif 141 142#endif /* __KERNEL__ */