Whamcloud - gitweb
LU-12477 ldiskfs: drop SUSE kernel 4.4 and earlier
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / suse15 / ext4-osd-iop-common.patch
1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index fcc2055..832da02 100644
3 --- a/fs/ext4/ext4.h
4 +++ b/fs/ext4/ext4.h
5 @@ -2543,6 +2543,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,
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 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 cb35943..775925d 100644
20 --- a/fs/ext4/namei.c
21 +++ b/fs/ext4/namei.c
22 @@ -2379,7 +2379,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 @@ -2419,7 +2419,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 @@ -2463,6 +2463,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