diff options
author | Tao Ma <boyu.mt@taobao.com> | 2012-12-10 14:04:46 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-12-10 14:04:46 -0500 |
commit | 67cf5b09a46f72e048501b84996f2f77bc42e947 (patch) | |
tree | a03218e2d47fc2ea9875fbd245e5b7ec3985e25e /fs/ext4/xattr.h | |
parent | 879b38257bf2b6fa8406693a3b5b5a0649e7c594 (diff) |
ext4: add the basic function for inline data support
Implement inline data with xattr.
Now we use "system.data" to store xattr, and the xattr will
be extended if the i_size is increased while we don't release
the space during truncate.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/xattr.h')
-rw-r--r-- | fs/ext4/xattr.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h index 40ca7a6f5eec..7ae0d05156e3 100644 --- a/fs/ext4/xattr.h +++ b/fs/ext4/xattr.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define EXT4_XATTR_INDEX_TRUSTED 4 | 21 | #define EXT4_XATTR_INDEX_TRUSTED 4 |
22 | #define EXT4_XATTR_INDEX_LUSTRE 5 | 22 | #define EXT4_XATTR_INDEX_LUSTRE 5 |
23 | #define EXT4_XATTR_INDEX_SECURITY 6 | 23 | #define EXT4_XATTR_INDEX_SECURITY 6 |
24 | #define EXT4_XATTR_INDEX_SYSTEM 7 | ||
24 | 25 | ||
25 | struct ext4_xattr_header { | 26 | struct ext4_xattr_header { |
26 | __le32 h_magic; /* magic number for identification */ | 27 | __le32 h_magic; /* magic number for identification */ |
@@ -125,6 +126,19 @@ extern int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | |||
125 | struct ext4_xattr_info *i, | 126 | struct ext4_xattr_info *i, |
126 | struct ext4_xattr_ibody_find *is); | 127 | struct ext4_xattr_ibody_find *is); |
127 | 128 | ||
129 | extern int ext4_has_inline_data(struct inode *inode); | ||
130 | extern int ext4_get_inline_size(struct inode *inode); | ||
131 | extern int ext4_get_max_inline_size(struct inode *inode); | ||
132 | extern int ext4_find_inline_data_nolock(struct inode *inode); | ||
133 | extern void ext4_write_inline_data(struct inode *inode, | ||
134 | struct ext4_iloc *iloc, | ||
135 | void *buffer, loff_t pos, | ||
136 | unsigned int len); | ||
137 | extern int ext4_prepare_inline_data(handle_t *handle, struct inode *inode, | ||
138 | unsigned int len); | ||
139 | extern int ext4_init_inline_data(handle_t *handle, struct inode *inode, | ||
140 | unsigned int len); | ||
141 | extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode); | ||
128 | # else /* CONFIG_EXT4_FS_XATTR */ | 142 | # else /* CONFIG_EXT4_FS_XATTR */ |
129 | 143 | ||
130 | static inline int | 144 | static inline int |
@@ -201,6 +215,46 @@ ext4_xattr_ibody_get(struct inode *inode, int name_index, | |||
201 | return -EOPNOTSUPP; | 215 | return -EOPNOTSUPP; |
202 | } | 216 | } |
203 | 217 | ||
218 | static inline int ext4_find_inline_data_nolock(struct inode *inode) | ||
219 | { | ||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static inline int ext4_has_inline_data(struct inode *inode) | ||
224 | { | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | static inline int ext4_get_inline_size(struct inode *inode) | ||
229 | { | ||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | static inline int ext4_get_max_inline_size(struct inode *inode) | ||
234 | { | ||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static inline void ext4_write_inline_data(struct inode *inode, | ||
239 | struct ext4_iloc *iloc, | ||
240 | void *buffer, loff_t pos, | ||
241 | unsigned int len) | ||
242 | { | ||
243 | return; | ||
244 | } | ||
245 | |||
246 | static inline int ext4_init_inline_data(handle_t *handle, | ||
247 | struct inode *inode, | ||
248 | unsigned int len) | ||
249 | { | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static inline int ext4_destroy_inline_data(handle_t *handle, | ||
254 | struct inode *inode) | ||
255 | { | ||
256 | return 0; | ||
257 | } | ||
204 | # endif /* CONFIG_EXT4_FS_XATTR */ | 258 | # endif /* CONFIG_EXT4_FS_XATTR */ |
205 | 259 | ||
206 | #ifdef CONFIG_EXT4_FS_SECURITY | 260 | #ifdef CONFIG_EXT4_FS_SECURITY |