Whamcloud - gitweb
LU-13004 modules: replace lnet_kiov_t with struct bio_vec
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel7 / ext4-osd-iop-common.patch
1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index fa0f45ae..8f89024e 100644
3 --- a/fs/ext4/ext4.h
4 +++ b/fs/ext4/ext4.h
5 @@ -2239,6 +2239,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,
11 +                                      uid_t *owner);
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,
16                       char *search_buf,
17                       int buf_size,
18 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
19 index 8e265e61..77d0782c 100644
20 --- a/fs/ext4/namei.c
21 +++ b/fs/ext4/namei.c
22 @@ -2176,7 +2176,7 @@ int ext4_generic_delete_entry(handle_t *handle,
23         return -ENOENT;
24  }
25  
26 -static int ext4_delete_entry(handle_t *handle,
27 +int ext4_delete_entry(handle_t *handle,
28                              struct inode *dir,
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);
33         return err;
34  }
35 -
36 +EXPORT_SYMBOL(ext4_delete_entry);
37  /*
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,
41         return err;
42  }
43  
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,
47 +                               uid_t *owner)
48 +{
49 +       struct inode *inode;
50 +
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;
56 +#endif
57 +               } else {
58 +                       inode->i_op = &ext4_file_inode_operations;
59 +                       inode->i_fop = &ext4_file_operations;
60 +                       ext4_set_aops(inode);
61 +               }
62 +       }
63 +       return inode;
64 +}
65 +EXPORT_SYMBOL(ext4_create_inode);
66 +
67  /*
68   * By the time this is called, we already have created
69   * the directory cache entry for the new file, but it