diff options
Diffstat (limited to 'fs/ext4/xattr.h')
-rw-r--r-- | fs/ext4/xattr.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h index 91f31ca7d9a..40ca7a6f5ee 100644 --- a/fs/ext4/xattr.h +++ b/fs/ext4/xattr.h | |||
@@ -65,6 +65,32 @@ struct ext4_xattr_entry { | |||
65 | EXT4_I(inode)->i_extra_isize)) | 65 | EXT4_I(inode)->i_extra_isize)) |
66 | #define IFIRST(hdr) ((struct ext4_xattr_entry *)((hdr)+1)) | 66 | #define IFIRST(hdr) ((struct ext4_xattr_entry *)((hdr)+1)) |
67 | 67 | ||
68 | #define BHDR(bh) ((struct ext4_xattr_header *)((bh)->b_data)) | ||
69 | #define ENTRY(ptr) ((struct ext4_xattr_entry *)(ptr)) | ||
70 | #define BFIRST(bh) ENTRY(BHDR(bh)+1) | ||
71 | #define IS_LAST_ENTRY(entry) (*(__u32 *)(entry) == 0) | ||
72 | |||
73 | |||
74 | struct ext4_xattr_info { | ||
75 | int name_index; | ||
76 | const char *name; | ||
77 | const void *value; | ||
78 | size_t value_len; | ||
79 | }; | ||
80 | |||
81 | struct ext4_xattr_search { | ||
82 | struct ext4_xattr_entry *first; | ||
83 | void *base; | ||
84 | void *end; | ||
85 | struct ext4_xattr_entry *here; | ||
86 | int not_found; | ||
87 | }; | ||
88 | |||
89 | struct ext4_xattr_ibody_find { | ||
90 | struct ext4_xattr_search s; | ||
91 | struct ext4_iloc iloc; | ||
92 | }; | ||
93 | |||
68 | # ifdef CONFIG_EXT4_FS_XATTR | 94 | # ifdef CONFIG_EXT4_FS_XATTR |
69 | 95 | ||
70 | extern const struct xattr_handler ext4_xattr_user_handler; | 96 | extern const struct xattr_handler ext4_xattr_user_handler; |
@@ -90,6 +116,15 @@ extern void ext4_exit_xattr(void); | |||
90 | 116 | ||
91 | extern const struct xattr_handler *ext4_xattr_handlers[]; | 117 | extern const struct xattr_handler *ext4_xattr_handlers[]; |
92 | 118 | ||
119 | extern int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, | ||
120 | struct ext4_xattr_ibody_find *is); | ||
121 | extern int ext4_xattr_ibody_get(struct inode *inode, int name_index, | ||
122 | const char *name, | ||
123 | void *buffer, size_t buffer_size); | ||
124 | extern int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | ||
125 | struct ext4_xattr_info *i, | ||
126 | struct ext4_xattr_ibody_find *is); | ||
127 | |||
93 | # else /* CONFIG_EXT4_FS_XATTR */ | 128 | # else /* CONFIG_EXT4_FS_XATTR */ |
94 | 129 | ||
95 | static inline int | 130 | static inline int |
@@ -143,6 +178,29 @@ ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, | |||
143 | 178 | ||
144 | #define ext4_xattr_handlers NULL | 179 | #define ext4_xattr_handlers NULL |
145 | 180 | ||
181 | static inline int | ||
182 | ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, | ||
183 | struct ext4_xattr_ibody_find *is) | ||
184 | { | ||
185 | return -EOPNOTSUPP; | ||
186 | } | ||
187 | |||
188 | static inline int | ||
189 | ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | ||
190 | struct ext4_xattr_info *i, | ||
191 | struct ext4_xattr_ibody_find *is) | ||
192 | { | ||
193 | return -EOPNOTSUPP; | ||
194 | } | ||
195 | |||
196 | static inline int | ||
197 | ext4_xattr_ibody_get(struct inode *inode, int name_index, | ||
198 | const char *name, | ||
199 | void *buffer, size_t buffer_size) | ||
200 | { | ||
201 | return -EOPNOTSUPP; | ||
202 | } | ||
203 | |||
146 | # endif /* CONFIG_EXT4_FS_XATTR */ | 204 | # endif /* CONFIG_EXT4_FS_XATTR */ |
147 | 205 | ||
148 | #ifdef CONFIG_EXT4_FS_SECURITY | 206 | #ifdef CONFIG_EXT4_FS_SECURITY |