Whamcloud - gitweb
0d3a44157b8b064ae4819faab0015d0ce2e01444
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel7.6 / ext4-osd-iop-common.patch
1 Index: linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-3.10.0-123.13.2.el7.x86_64.orig/fs/ext4/ext4.h
4 +++ linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/ext4.h
5 @@ -2145,6 +2145,11 @@ extern int ext4_orphan_add(handle_t *, s
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 +extern int ext4_delete_entry(handle_t *handle, struct inode * dir,
12 +                            struct ext4_dir_entry_2 *de_del,
13 +                            struct buffer_head *bh);
14  extern int search_dir(struct buffer_head *bh,
15                       char *search_buf,
16                       int buf_size,
17 Index: linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/namei.c
18 ===================================================================
19 --- linux-3.10.0-123.13.2.el7.x86_64.orig/fs/ext4/namei.c
20 +++ linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/namei.c
21 @@ -2165,7 +2167,7 @@ int ext4_generic_delete_entry(handle_t *
22         return -ENOENT;
23  }
24  
25 -static int ext4_delete_entry(handle_t *handle,
26 +int ext4_delete_entry(handle_t *handle,
27                              struct inode *dir,
28                              struct ext4_dir_entry_2 *de_del,
29                              struct buffer_head *bh)
30 @@ -2206,7 +2208,7 @@ out:
31                 ext4_std_error(dir->i_sb, err);
32         return err;
33  }
34 -
35 +EXPORT_SYMBOL(ext4_delete_entry);
36  /*
37   * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
38   * since this indicates that nlinks count was previously 1.
39 @@ -2253,6 +2255,28 @@ static int ext4_add_nondir(handle_t *han
40         return err;
41  }
42  
43 + /* Return locked inode, then the caller can modify the inode's states/flags
44 +  * before others finding it. The caller should unlock the inode by itself. */
45 +struct inode *ext4_create_inode(handle_t *handle, struct inode *dir, int mode)
46 +{
47 +       struct inode *inode;
48 +
49 +       inode = ext4_new_inode(handle, dir, mode, NULL, 0, NULL);
50 +       if (!IS_ERR(inode)) {
51 +               if (S_ISCHR(mode) || S_ISBLK(mode) || S_ISFIFO(mode)) {
52 +#ifdef CONFIG_LDISKFS_FS_XATTR
53 +                       inode->i_op = &ext4_special_inode_operations;
54 +#endif
55 +               } else {
56 +                       inode->i_op = &ext4_file_inode_operations;
57 +                       inode->i_fop = &ext4_file_operations.kabi_fops;
58 +                       ext4_set_aops(inode);
59 +               }
60 +       }
61 +       return inode;
62 +}
63 +EXPORT_SYMBOL(ext4_create_inode);
64 +
65  /*
66   * By the time this is called, we already have created
67   * the directory cache entry for the new file, but it