1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index d4c79c12..8979e06b 100644
5 @@ -2222,6 +2222,12 @@ extern int ext4_orphan_add(handle_t *, struct inode *);
6 extern int ext4_orphan_del(handle_t *, struct inode *);
7 extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
8 __u32 start_minor_hash, __u32 *next_hash);
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 search_dir(struct buffer_head *bh,
18 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
19 index 1821d9a4..140163d3 100644
22 @@ -2176,7 +2176,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 @@ -2216,7 +2216,7 @@ out:
32 ext4_std_error(dir->i_sb, err);
36 +EXPORT_SYMBOL(ext4_delete_entry);
38 * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
39 * since this indicates that nlinks count was previously 1.
40 @@ -2263,6 +2263,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);
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.kabi_fops;
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