aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/xattr.h
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2012-12-10 14:05:59 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-12-10 14:05:59 -0500
commit3c47d54170b6a678875566b1b8d6dcf57904e49b (patch)
tree6fdde24d7d168265eb227e63c209f23931e7f53b /fs/ext4/xattr.h
parent978fef914a2e6b8ad5672d0a39f9201b7aa7c396 (diff)
ext4: let add_dir_entry handle inline data properly
This patch let add_dir_entry handle the inline data case. So the dir is initialized as inline dir first and then we can try to add some files to it, when the inline space can't hold all the entries, a dir block will be created and the dir entry will be moved to it. Also for an inlined dir, "." and ".." are removed and we only use 4 bytes to store the parent inode number. These 2 entries will be added when we convert an inline dir to a block-based one. [ Folded in patch from Dan Carpenter to remove an unused variable. ] Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/xattr.h')
-rw-r--r--fs/ext4/xattr.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
index 37e66f867645..397ef4bbaf1e 100644
--- a/fs/ext4/xattr.h
+++ b/fs/ext4/xattr.h
@@ -163,6 +163,11 @@ extern int ext4_da_write_inline_data_begin(struct address_space *mapping,
163extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, 163extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
164 unsigned len, unsigned copied, 164 unsigned len, unsigned copied,
165 struct page *page); 165 struct page *page);
166extern int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry,
167 struct inode *inode);
168extern int ext4_try_create_inline_dir(handle_t *handle,
169 struct inode *parent,
170 struct inode *inode);
166# else /* CONFIG_EXT4_FS_XATTR */ 171# else /* CONFIG_EXT4_FS_XATTR */
167 172
168static inline int 173static inline int
@@ -327,6 +332,20 @@ static inline int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
327{ 332{
328 return 0; 333 return 0;
329} 334}
335
336static inline int ext4_try_add_inline_entry(handle_t *handle,
337 struct dentry *dentry,
338 struct inode *inode)
339{
340 return 0;
341}
342
343static inline int ext4_try_create_inline_dir(handle_t *handle,
344 struct inode *parent,
345 struct inode *inode)
346{
347 return 0;
348}
330# endif /* CONFIG_EXT4_FS_XATTR */ 349# endif /* CONFIG_EXT4_FS_XATTR */
331 350
332#ifdef CONFIG_EXT4_FS_SECURITY 351#ifdef CONFIG_EXT4_FS_SECURITY