2 fs/ext4/ext4.h | 23 ++++++++++++++++++++++-
3 fs/ext4/ialloc.c | 3 ++-
4 fs/ext4/inode.c | 15 +++++++++++++++
5 fs/ext4/namei.c | 9 ++++++---
6 fs/ext4/super.c | 10 ++--------
7 5 files changed, 47 insertions(+), 13 deletions(-)
11 @@ -1630,6 +1630,8 @@ static inline void ext4_clear_state_flag
13 #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
15 +#define JOURNAL_START_HAS_3ARGS 1
18 * Codes for operating systems
20 @@ -1842,7 +1844,21 @@ static inline bool ext4_has_unknown_ext#
24 -EXTN_FEATURE_FUNCS(4)
25 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
27 + return ((EXT4_SB(sb)->s_es->s_feature_compat &
28 + cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
30 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
32 + return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
33 + cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
35 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
37 + return ((EXT4_SB(sb)->s_es->s_feature_incompat &
38 + cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
41 static inline bool ext4_has_compat_features(struct super_block *sb)
43 @@ -3133,6 +3149,13 @@ struct ext4_extent;
45 extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
46 extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
47 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
48 + ext4_group_t block_group);
49 +extern void ext4_inc_count(handle_t *handle, struct inode *inode);
50 +extern void ext4_dec_count(handle_t *handle, struct inode *inode);
51 +extern struct buffer_head *ext4_append(handle_t *handle,
52 + struct inode *inode,
53 + ext4_lblk_t *block);
54 extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
55 extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
56 struct ext4_map_blocks *map, int flags);
57 --- a/fs/ext4/ialloc.c
58 +++ b/fs/ext4/ialloc.c
59 @@ -120,7 +120,7 @@ verified:
61 * Return buffer_head of bitmap on success or NULL.
63 -static struct buffer_head *
65 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
67 struct ext4_group_desc *desc;
68 @@ -213,6 +213,7 @@ out:
72 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
75 * NOTE! When we get the inode, we're the only people
78 @@ -6253,3 +6253,18 @@ int ext4_get_next_extent(struct inode *i
82 +EXPORT_SYMBOL(ext4_map_blocks);
83 +EXPORT_SYMBOL(ext4_truncate);
84 +EXPORT_SYMBOL(__ext4_iget);
85 +EXPORT_SYMBOL(ext4_bread);
86 +EXPORT_SYMBOL(ext4_itable_unused_count);
87 +EXPORT_SYMBOL(ext4_force_commit);
88 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
89 +EXPORT_SYMBOL(ext4_get_group_desc);
90 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
91 +EXPORT_SYMBOL(__ext4_journal_start_sb);
92 +EXPORT_SYMBOL(__ext4_journal_stop);
93 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
94 +EXPORT_SYMBOL(__ext4_std_error);
95 +EXPORT_SYMBOL(ext4fs_dirhash);
96 +EXPORT_SYMBOL(ext4_get_inode_loc);
100 #define NAMEI_RA_BLOCKS 4
101 #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
103 -static struct buffer_head *ext4_append(handle_t *handle,
104 +struct buffer_head *ext4_append(handle_t *handle,
108 @@ -159,6 +159,7 @@ static struct buffer_head *__ext4_read_d
112 +EXPORT_SYMBOL(ext4_append);
115 #define assert(test) J_ASSERT(test)
116 @@ -2392,7 +2393,7 @@ EXPORT_SYMBOL(ext4_delete_entry);
117 * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
118 * since this indicates that nlinks count was previously 1.
120 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
121 +void ext4_inc_count(handle_t *handle, struct inode *inode)
124 if (is_dx(inode) && inode->i_nlink > 1) {
125 @@ -2403,16 +2404,18 @@ static void ext4_inc_count(handle_t *han
129 +EXPORT_SYMBOL(ext4_inc_count);
132 * If a directory had nlink == 1, then we should let it be 1. This indicates
133 * directory has >EXT4_LINK_MAX subdirs.
135 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
136 +void ext4_dec_count(handle_t *handle, struct inode *inode)
138 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
141 +EXPORT_SYMBOL(ext4_dec_count);
144 static int ext4_add_nondir(handle_t *handle,
145 --- a/fs/ext4/super.c
146 +++ b/fs/ext4/super.c
147 @@ -326,11 +326,11 @@ static void __save_error_info(struct sup
149 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
150 es->s_last_error_time = cpu_to_le32(get_seconds());
151 - strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
152 + strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
153 es->s_last_error_line = cpu_to_le32(line);
154 if (!es->s_first_error_time) {
155 es->s_first_error_time = es->s_last_error_time;
156 - strncpy(es->s_first_error_func, func,
157 + strlcpy(es->s_first_error_func, func,
158 sizeof(es->s_first_error_func));
159 es->s_first_error_line = cpu_to_le32(line);
160 es->s_first_error_ino = es->s_last_error_ino;
161 @@ -5899,16 +5899,12 @@ static int __init ext4_init_fs(void)
162 err = init_inodecache();
165 - register_as_ext3();
166 - register_as_ext2();
167 err = register_filesystem(&ext4_fs_type);
173 - unregister_as_ext2();
174 - unregister_as_ext3();
175 destroy_inodecache();
178 @@ -5927,8 +5923,6 @@ out5:
179 static void __exit ext4_exit_fs(void)
181 ext4_destroy_lazyinit_thread();
182 - unregister_as_ext2();
183 - unregister_as_ext3();
184 unregister_filesystem(&ext4_fs_type);
185 destroy_inodecache();