Whamcloud - gitweb
LU-15635 ldiskfs: Interface change fix server v5.10
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ubuntu19 / ext4-misc.patch
1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index 0df15ed..da97ee5 100644
3 --- a/fs/ext4/ext4.h
4 +++ b/fs/ext4/ext4.h
5 @@ -1603,6 +1603,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
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 @@ -1817,7 +1819,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
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 @@ -3136,6 +3152,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 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
52 index 66041d1..1404f64 100644
53 --- a/fs/ext4/ialloc.c
54 +++ b/fs/ext4/ialloc.c
55 @@ -114,7 +114,7 @@ verified:
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 @@ -211,6 +211,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 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
73 index 306d64b..890aa90 100644
74 --- a/fs/ext4/inode.c
75 +++ b/fs/ext4/inode.c
76 @@ -6325,3 +6325,18 @@ vm_fault_t ext4_filemap_fault(struct vm_fault *vmf)
77  
78         return ret;
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 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
96 index 41aa6d9..88a84ec 100644
97 --- a/fs/ext4/namei.c
98 +++ b/fs/ext4/namei.c
99 @@ -49,7 +49,7 @@
100  #define NAMEI_RA_BLOCKS  4
101  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
102  
103 -static struct buffer_head *ext4_append(handle_t *handle,
104 +struct buffer_head *ext4_append(handle_t *handle,
105                                         struct inode *inode,
106                                         ext4_lblk_t *block)
107  {
108 @@ -160,6 +160,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
109         }
110         return bh;
111  }
112 +EXPORT_SYMBOL(ext4_append);
113  
114  #ifndef assert
115  #define assert(test) J_ASSERT(test)
116 @@ -2415,23 +2416,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
117   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
118   * on regular files) and to avoid creating huge/slow non-HTREE directories.
119   */
120 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
121 +void ext4_inc_count(handle_t *handle, struct inode *inode)
122  {
123         inc_nlink(inode);
124         if (is_dx(inode) &&
125             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
126                 set_nlink(inode, 1);
127  }
128 +EXPORT_SYMBOL(ext4_inc_count);
129  
130  /*
131   * If a directory had nlink == 1, then we should let it be 1. This indicates
132   * directory has >EXT4_LINK_MAX subdirs.
133   */
134 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
135 +void ext4_dec_count(handle_t *handle, struct inode *inode)
136  {
137         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
138                 drop_nlink(inode);
139  }
140 +EXPORT_SYMBOL(ext4_dec_count);
141  
142  
143  static int ext4_add_nondir(handle_t *handle,
144 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
145 index 21a7d00..07d126c 100644
146 --- a/fs/ext4/super.c
147 +++ b/fs/ext4/super.c
148 @@ -369,12 +369,12 @@ static void __save_error_info(struct super_block *sb, const char *func,
149                 return;
150         es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
151         ext4_update_tstamp(es, s_last_error_time);
152 -       strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
153 +       strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
154         es->s_last_error_line = cpu_to_le32(line);
155         if (!es->s_first_error_time) {
156                 es->s_first_error_time = es->s_last_error_time;
157                 es->s_first_error_time_hi = es->s_last_error_time_hi;
158 -               strncpy(es->s_first_error_func, func,
159 +               strlcpy(es->s_first_error_func, func,
160                         sizeof(es->s_first_error_func));
161                 es->s_first_error_line = cpu_to_le32(line);
162                 es->s_first_error_ino = es->s_last_error_ino;
163 @@ -6061,16 +6061,12 @@ static int __init ext4_init_fs(void)
164         err = init_inodecache();
165         if (err)
166                 goto out1;
167 -       register_as_ext3();
168 -       register_as_ext2();
169         err = register_filesystem(&ext4_fs_type);
170         if (err)
171                 goto out;
172  
173         return 0;
174  out:
175 -       unregister_as_ext2();
176 -       unregister_as_ext3();
177         destroy_inodecache();
178  out1:
179         ext4_exit_mballoc();
180 @@ -6091,8 +6087,6 @@ out6:
181  static void __exit ext4_exit_fs(void)
182  {
183         ext4_destroy_lazyinit_thread();
184 -       unregister_as_ext2();
185 -       unregister_as_ext3();
186         unregister_filesystem(&ext4_fs_type);
187         destroy_inodecache();
188         ext4_exit_mballoc();