1 diff -ur a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 --- a/fs/ext4/ext4.h 2022-03-24 16:23:11.725060881 -0600
3 +++ b/fs/ext4/ext4.h 2022-03-24 16:24:35.400642866 -0600
6 #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
8 +#define JOURNAL_START_HAS_3ARGS 1
11 * Codes for operating systems
13 @@ -2121,7 +2123,21 @@
17 -EXTN_FEATURE_FUNCS(4)
18 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
20 + return ((EXT4_SB(sb)->s_es->s_feature_compat &
21 + cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
23 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
25 + return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
26 + cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
28 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
30 + return ((EXT4_SB(sb)->s_es->s_feature_incompat &
31 + cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
34 static inline bool ext4_has_compat_features(struct super_block *sb)
36 @@ -3594,6 +3610,13 @@
37 #define EXT_MAX_BLOCKS 0xffffffff
39 extern void ext4_ext_tree_init(handle_t *handle, struct inode *inode);
40 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
41 + ext4_group_t block_group);
42 +extern void ext4_inc_count(struct inode *inode);
43 +extern void ext4_dec_count(struct inode *inode);
44 +extern struct buffer_head *ext4_append(handle_t *handle,
45 + struct inode *inode,
46 + ext4_lblk_t *block);
47 extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
48 extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
49 struct ext4_map_blocks *map, int flags);
50 diff -ur a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
51 --- a/fs/ext4/ialloc.c 2022-03-24 16:23:11.713060939 -0600
52 +++ b/fs/ext4/ialloc.c 2022-03-24 16:24:35.404642846 -0600
55 * Return buffer_head of bitmap on success, or an ERR_PTR on error.
57 -static struct buffer_head *
59 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
61 struct ext4_group_desc *desc;
66 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
69 * NOTE! When we get the inode, we're the only people
70 diff -ur a/fs/ext4/inode.c b/fs/ext4/inode.c
71 --- a/fs/ext4/inode.c 2022-03-24 16:23:11.721060900 -0600
72 +++ b/fs/ext4/inode.c 2022-03-24 16:24:35.412642805 -0600
73 @@ -6222,3 +6222,19 @@
77 +EXPORT_SYMBOL(ext4_map_blocks);
78 +EXPORT_SYMBOL(ext4_truncate);
79 +EXPORT_SYMBOL(ext4_iget);
80 +EXPORT_SYMBOL(ext4_bread);
81 +EXPORT_SYMBOL(ext4_itable_unused_count);
82 +EXPORT_SYMBOL(ext4_force_commit);
83 +EXPORT_SYMBOL(__ext4_mark_inode_dirty);
84 +EXPORT_SYMBOL(ext4_get_group_desc);
85 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
86 +EXPORT_SYMBOL(__ext4_journal_start_sb);
87 +EXPORT_SYMBOL(__ext4_journal_stop);
88 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
89 +EXPORT_SYMBOL(__ext4_std_error);
90 +EXPORT_SYMBOL(ext4fs_dirhash);
91 +EXPORT_SYMBOL(ext4_get_inode_loc);
92 +EXPORT_SYMBOL(__ext4_journal_ensure_credits);
93 diff -ur a/fs/ext4/namei.c b/fs/ext4/namei.c
94 --- a/fs/ext4/namei.c 2022-03-24 16:23:11.725060881 -0600
95 +++ b/fs/ext4/namei.c 2022-03-24 16:24:35.420642764 -0600
97 #define NAMEI_RA_BLOCKS 4
98 #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
100 -static struct buffer_head *ext4_append(handle_t *handle,
101 +struct buffer_head *ext4_append(handle_t *handle,
109 +#define assert(test) J_ASSERT(test)
111 static int ext4_dx_csum_verify(struct inode *inode,
112 struct ext4_dir_entry *dirent);
118 +EXPORT_SYMBOL(ext4_append);
121 #define dxtrace(command) command
122 @@ -2568,23 +2571,25 @@
123 * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
124 * on regular files) and to avoid creating huge/slow non-HTREE directories.
126 -static void ext4_inc_count(struct inode *inode)
127 +void ext4_inc_count(struct inode *inode)
131 (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
134 +EXPORT_SYMBOL(ext4_inc_count);
137 * If a directory had nlink == 1, then we should let it be 1. This indicates
138 * directory has >EXT4_LINK_MAX subdirs.
140 -static void ext4_dec_count(struct inode *inode)
141 +void ext4_dec_count(struct inode *inode)
143 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
146 +EXPORT_SYMBOL(ext4_dec_count);
150 diff -ur a/fs/ext4/super.c b/fs/ext4/super.c
151 --- a/fs/ext4/super.c 2022-03-24 16:23:11.601061482 -0600
152 +++ b/fs/ext4/super.c 2022-03-24 16:24:35.424642743 -0600
153 @@ -5557,7 +5557,7 @@
154 __ext4_update_tstamp(&es->s_first_error_time,
155 &es->s_first_error_time_hi,
156 sbi->s_first_error_time);
157 - strncpy(es->s_first_error_func, sbi->s_first_error_func,
158 + strlcpy(es->s_first_error_func, sbi->s_first_error_func,
159 sizeof(es->s_first_error_func));
160 es->s_first_error_line =
161 cpu_to_le32(sbi->s_first_error_line);
162 @@ -5571,7 +5571,7 @@
163 __ext4_update_tstamp(&es->s_last_error_time,
164 &es->s_last_error_time_hi,
165 sbi->s_last_error_time);
166 - strncpy(es->s_last_error_func, sbi->s_last_error_func,
167 + strlcpy(es->s_last_error_func, sbi->s_last_error_func,
168 sizeof(es->s_last_error_func));
169 es->s_last_error_line = cpu_to_le32(sbi->s_last_error_line);
170 es->s_last_error_ino = cpu_to_le32(sbi->s_last_error_ino);
171 @@ -6760,16 +6760,12 @@
175 - register_as_ext3();
176 - register_as_ext2();
177 err = register_filesystem(&ext4_fs_type);
183 - unregister_as_ext2();
184 - unregister_as_ext3();
186 destroy_inodecache();
188 @@ -6793,8 +6789,6 @@
189 static void __exit ext4_exit_fs(void)
191 ext4_destroy_lazyinit_thread();
192 - unregister_as_ext2();
193 - unregister_as_ext3();
194 unregister_filesystem(&ext4_fs_type);
195 destroy_inodecache();