1 commit b175e2441b0cd9fae60341ba92b0f7f192e71446
2 Author: girish <girish>
8 ext4 ldiskfs patches for rhel5
10 Index: kernel-4.18.0-423.el8/fs/ext4/ext4.h
11 ===================================================================
12 --- kernel-4.18.0-423.el8.orig/fs/ext4/ext4.h
13 +++ kernel-4.18.0-423.el8/fs/ext4/ext4.h
14 @@ -1903,7 +1905,21 @@ static inline bool ext4_has_unknown_ext#
18 -EXTN_FEATURE_FUNCS(4)
19 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
21 + return ((EXT4_SB(sb)->s_es->s_feature_compat &
22 + cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
24 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
26 + return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
27 + cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
29 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
31 + return ((EXT4_SB(sb)->s_es->s_feature_incompat &
32 + cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
35 static inline bool ext4_has_compat_features(struct super_block *sb)
37 @@ -3243,6 +3259,13 @@ struct ext4_extent;
38 #define EXT_MAX_BLOCKS 0xffffffff
40 extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
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.18.0-80.1.2.el8_0/fs/ext4/ialloc.c
52 ===================================================================
53 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/ialloc.c
54 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/ialloc.c
55 @@ -114,7 +114,7 @@ verified:
57 * Return buffer_head of bitmap on success or NULL.
59 -static struct buffer_head *
61 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
63 struct ext4_group_desc *desc;
64 @@ -211,6 +211,7 @@ out:
68 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
71 * NOTE! When we get the inode, we're the only people
72 Index: linux-4.18.0-240.1.1.el8/fs/ext4/inode.c
73 ===================================================================
74 --- linux-4.18.0-240.1.1.el8.orig/fs/ext4/inode.c
75 +++ linux-4.18.0-240.1.1.el8/fs/ext4/inode.c
76 @@ -6343,3 +6343,20 @@ vm_fault_t ext4_filemap_fault(struct vm_
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 +EXPORT_SYMBOL(__ext4_journal_ensure_credits);
96 +EXPORT_SYMBOL(ext4_chunk_trans_blocks);
97 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/namei.c
98 ===================================================================
99 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/namei.c
100 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/namei.c
102 #define NAMEI_RA_BLOCKS 4
103 #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
105 -static struct buffer_head *ext4_append(handle_t *handle,
106 +struct buffer_head *ext4_append(handle_t *handle,
110 @@ -160,6 +160,7 @@ static struct buffer_head *__ext4_read_d
114 +EXPORT_SYMBOL(ext4_append);
117 #define assert(test) J_ASSERT(test)
118 @@ -2415,23 +2416,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
119 * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
120 * on regular files) and to avoid creating huge/slow non-HTREE directories.
122 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
123 +void ext4_inc_count(handle_t *handle, struct inode *inode)
127 (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
130 +EXPORT_SYMBOL(ext4_inc_count);
133 * If a directory had nlink == 1, then we should let it be 1. This indicates
134 * directory has >EXT4_LINK_MAX subdirs.
136 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
137 +void ext4_dec_count(handle_t *handle, struct inode *inode)
139 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
142 +EXPORT_SYMBOL(ext4_dec_count);
145 static int ext4_add_nondir(handle_t *handle,
146 Index: linux-4.18.0-240.1.1.el8/fs/ext4/super.c
147 ===================================================================
148 --- linux-4.18.0-240.1.1.el8.orig/fs/ext4/super.c
149 +++ linux-4.18.0-240.1.1.el8/fs/ext4/super.c
150 @@ -366,7 +366,7 @@ static void __save_error_info(struct sup
152 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
153 ext4_update_tstamp(es, s_last_error_time);
154 - strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
155 + strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
156 es->s_last_error_line = cpu_to_le32(line);
157 es->s_last_error_ino = cpu_to_le32(ino);
158 es->s_last_error_block = cpu_to_le64(block);
159 @@ -427,7 +427,7 @@ static void __save_error_info(struct sup
160 if (!es->s_first_error_time) {
161 es->s_first_error_time = es->s_last_error_time;
162 es->s_first_error_time_hi = es->s_last_error_time_hi;
163 - strncpy(es->s_first_error_func, func,
164 + strlcpy(es->s_first_error_func, func,
165 sizeof(es->s_first_error_func));
166 es->s_first_error_line = cpu_to_le32(line);
167 es->s_first_error_ino = es->s_last_error_ino;
168 @@ -6152,16 +6152,12 @@ static int __init ext4_init_fs(void)
169 err = init_inodecache();
172 - register_as_ext3();
173 - register_as_ext2();
174 err = register_filesystem(&ext4_fs_type);
180 - unregister_as_ext2();
181 - unregister_as_ext3();
182 destroy_inodecache();
185 @@ -6182,8 +6178,6 @@ out6:
186 static void __exit ext4_exit_fs(void)
188 ext4_destroy_lazyinit_thread();
189 - unregister_as_ext2();
190 - unregister_as_ext3();
191 unregister_filesystem(&ext4_fs_type);
192 destroy_inodecache();