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