Whamcloud - gitweb
77591abb38f59387ea9aaa07f02fb4983f0eb64f
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ubuntu18 / ext4-misc.patch
1 Index: linux-4.15.0/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-4.15.0.orig/fs/ext4/ext4.h
4 +++ linux-4.15.0/fs/ext4/ext4.h
5 @@ -1587,6 +1587,8 @@ static inline void ext4_clear_state_flag
6   */
7  #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
8  
9 +#define JOURNAL_START_HAS_3ARGS        1
10 +
11  /*
12   * Codes for operating systems
13   */
14 @@ -1801,7 +1803,21 @@ static inline bool ext4_has_unknown_ext#
15  
16  EXTN_FEATURE_FUNCS(2)
17  EXTN_FEATURE_FUNCS(3)
18 -EXTN_FEATURE_FUNCS(4)
19 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
20 +{
21 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
22 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
23 +}
24 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
25 +{
26 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
27 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
28 +}
29 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
30 +{
31 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
32 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
33 +}
34  
35  static inline bool ext4_has_compat_features(struct super_block *sb)
36  {
37 @@ -3103,6 +3119,13 @@ struct ext4_extent;
38  
39  extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
40  extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
41 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
42 +                                                 ext4_group_t block_group);
43 +extern void ext4_inc_count(handle_t *handle, struct inode *inode);
44 +extern void ext4_dec_count(handle_t *handle, struct inode *inode);
45 +extern struct buffer_head *ext4_append(handle_t *handle,
46 +                                      struct inode *inode,
47 +                                      ext4_lblk_t *block);
48  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
49  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
50                                struct ext4_map_blocks *map, int flags);
51 Index: linux-4.15.0/fs/ext4/ialloc.c
52 ===================================================================
53 --- linux-4.15.0.orig/fs/ext4/ialloc.c
54 +++ linux-4.15.0/fs/ext4/ialloc.c
55 @@ -156,7 +156,7 @@ static int ext4_validate_inode_bitmap(st
56   *
57   * Return buffer_head of bitmap on success or NULL.
58   */
59 -static struct buffer_head *
60 +struct buffer_head *
61  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
62  {
63         struct ext4_group_desc *desc;
64 @@ -236,6 +236,7 @@ out:
65         put_bh(bh);
66         return ERR_PTR(err);
67  }
68 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
69  
70  /*
71   * NOTE! When we get the inode, we're the only people
72 Index: linux-4.15.0/fs/ext4/inode.c
73 ===================================================================
74 --- linux-4.15.0.orig/fs/ext4/inode.c
75 +++ linux-4.15.0/fs/ext4/inode.c
76 @@ -6179,3 +6179,18 @@ int ext4_filemap_fault(struct vm_fault *
77  
78         return err;
79  }
80 +EXPORT_SYMBOL(ext4_map_blocks);
81 +EXPORT_SYMBOL(ext4_truncate);
82 +EXPORT_SYMBOL(ext4_iget);
83 +EXPORT_SYMBOL(ext4_bread);
84 +EXPORT_SYMBOL(ext4_itable_unused_count);
85 +EXPORT_SYMBOL(ext4_force_commit);
86 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
87 +EXPORT_SYMBOL(ext4_get_group_desc);
88 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
89 +EXPORT_SYMBOL(__ext4_journal_start_sb);
90 +EXPORT_SYMBOL(__ext4_journal_stop);
91 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
92 +EXPORT_SYMBOL(__ext4_std_error);
93 +EXPORT_SYMBOL(ext4fs_dirhash);
94 +EXPORT_SYMBOL(ext4_get_inode_loc);
95 Index: linux-4.15.0/fs/ext4/mballoc.c
96 ===================================================================
97 --- linux-4.15.0.orig/fs/ext4/mballoc.c
98 +++ linux-4.15.0/fs/ext4/mballoc.c
99 @@ -721,7 +721,6 @@ void ext4_mb_generate_buddy(struct super
100                                 void *buddy, void *bitmap, ext4_group_t group)
101  {
102         struct ext4_group_info *grp = ext4_get_group_info(sb, group);
103 -       struct ext4_sb_info *sbi = EXT4_SB(sb);
104         ext4_grpblk_t max = EXT4_CLUSTERS_PER_GROUP(sb);
105         ext4_grpblk_t i = 0;
106         ext4_grpblk_t first;
107 Index: linux-4.15.0/fs/ext4/namei.c
108 ===================================================================
109 --- linux-4.15.0.orig/fs/ext4/namei.c
110 +++ linux-4.15.0/fs/ext4/namei.c
111 @@ -48,7 +48,7 @@
112  #define NAMEI_RA_BLOCKS  4
113  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
114  
115 -static struct buffer_head *ext4_append(handle_t *handle,
116 +struct buffer_head *ext4_append(handle_t *handle,
117                                         struct inode *inode,
118                                         ext4_lblk_t *block)
119  {
120 @@ -158,6 +158,7 @@ static struct buffer_head *__ext4_read_d
121         }
122         return bh;
123  }
124 +EXPORT_SYMBOL(ext4_append);
125  
126  #ifndef assert
127  #define assert(test) J_ASSERT(test)
128 @@ -2412,23 +2413,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
129   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
130   * on regular files) and to avoid creating huge/slow non-HTREE directories.
131   */
132 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
133 +void ext4_inc_count(handle_t *handle, struct inode *inode)
134  {
135         inc_nlink(inode);
136         if (is_dx(inode) &&
137             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
138                 set_nlink(inode, 1);
139  }
140 +EXPORT_SYMBOL(ext4_inc_count);
141  
142  /*
143   * If a directory had nlink == 1, then we should let it be 1. This indicates
144   * directory has >EXT4_LINK_MAX subdirs.
145   */
146 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
147 +void ext4_dec_count(handle_t *handle, struct inode *inode)
148  {
149         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
150                 drop_nlink(inode);
151  }
152 +EXPORT_SYMBOL(ext4_dec_count);
153  
154  
155  static int ext4_add_nondir(handle_t *handle,
156 Index: linux-4.15.0/fs/ext4/super.c
157 ===================================================================
158 --- linux-4.15.0.orig/fs/ext4/super.c
159 +++ linux-4.15.0/fs/ext4/super.c
160 @@ -5860,16 +5860,12 @@ static int __init ext4_init_fs(void)
161         err = init_inodecache();
162         if (err)
163                 goto out1;
164 -       register_as_ext3();
165 -       register_as_ext2();
166         err = register_filesystem(&ext4_fs_type);
167         if (err)
168                 goto out;
169  
170         return 0;
171  out:
172 -       unregister_as_ext2();
173 -       unregister_as_ext3();
174         destroy_inodecache();
175  out1:
176         ext4_exit_mballoc();
177 @@ -5888,8 +5884,6 @@ out5:
178  static void __exit ext4_exit_fs(void)
179  {
180         ext4_destroy_lazyinit_thread();
181 -       unregister_as_ext2();
182 -       unregister_as_ext3();
183         unregister_filesystem(&ext4_fs_type);
184         destroy_inodecache();
185         ext4_exit_mballoc();