From 3c47d54170b6a678875566b1b8d6dcf57904e49b Mon Sep 17 00:00:00 2001 From: Tao Ma Date: Mon, 10 Dec 2012 14:05:59 -0500 Subject: 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 Signed-off-by: Dan Carpenter Signed-off-by: "Theodore Ts'o" --- fs/ext4/xattr.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'fs/ext4/xattr.h') 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, extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, unsigned copied, struct page *page); +extern int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry, + struct inode *inode); +extern int ext4_try_create_inline_dir(handle_t *handle, + struct inode *parent, + struct inode *inode); # else /* CONFIG_EXT4_FS_XATTR */ static inline int @@ -327,6 +332,20 @@ static inline int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, { return 0; } + +static inline int ext4_try_add_inline_entry(handle_t *handle, + struct dentry *dentry, + struct inode *inode) +{ + return 0; +} + +static inline int ext4_try_create_inline_dir(handle_t *handle, + struct inode *parent, + struct inode *inode) +{ + return 0; +} # endif /* CONFIG_EXT4_FS_XATTR */ #ifdef CONFIG_EXT4_FS_SECURITY -- cgit v1.2.3