1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index 91c73b231e58..e6c4550bbf0e 100644
5 @@ -2504,6 +2504,12 @@ extern int ext4_dirent_csum_verify(struct inode *inode,
6 struct ext4_dir_entry *dirent);
7 extern int ext4_orphan_add(handle_t *, struct inode *);
8 extern int ext4_orphan_del(handle_t *, struct inode *);
9 +extern struct inode *ext4_create_inode(handle_t *handle,
10 + struct inode *dir, int mode,
12 +extern int ext4_delete_entry(handle_t *handle, struct inode * dir,
13 + struct ext4_dir_entry_2 *de_del,
14 + struct buffer_head *bh);
15 extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
16 __u32 start_minor_hash, __u32 *next_hash);
17 extern int ext4_search_dir(struct buffer_head *bh,
18 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
19 index 19e34b23ffe0..b9955ddb390a 100644
22 @@ -2360,7 +2360,7 @@ int ext4_generic_delete_entry(handle_t *handle,
26 -static int ext4_delete_entry(handle_t *handle,
27 +int ext4_delete_entry(handle_t *handle,
29 struct ext4_dir_entry_2 *de_del,
30 struct buffer_head *bh)
31 @@ -2400,7 +2400,7 @@ static int ext4_delete_entry(handle_t *handle,
32 ext4_std_error(dir->i_sb, err);
36 +EXPORT_SYMBOL(ext4_delete_entry);
38 * Set directory link count to 1 if nlinks > EXT4_LINK_MAX, or if nlinks == 2
39 * since this indicates that nlinks count was previously 1 to avoid overflowing
40 @@ -2447,6 +2447,29 @@ static int ext4_add_nondir(handle_t *handle,
44 + /* Return locked inode, then the caller can modify the inode's states/flags
45 + * before others finding it. The caller should unlock the inode by itself. */
46 +struct inode *ext4_create_inode(handle_t *handle, struct inode *dir, int mode,
49 + struct inode *inode;
51 + inode = ext4_new_inode(handle, dir, mode, NULL, 0, owner, 0);
52 + if (!IS_ERR(inode)) {
53 + if (S_ISCHR(mode) || S_ISBLK(mode) || S_ISFIFO(mode)) {
54 +#ifdef CONFIG_LDISKFS_FS_XATTR
55 + inode->i_op = &ext4_special_inode_operations;
58 + inode->i_op = &ext4_file_inode_operations;
59 + inode->i_fop = &ext4_file_operations;
60 + ext4_set_aops(inode);
65 +EXPORT_SYMBOL(ext4_create_inode);
68 * By the time this is called, we already have created
69 * the directory cache entry for the new file, but it