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,11 @@ 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 struct buffer_head *ext4_append(handle_t *handle,
50 + struct inode *inode,
51 + ext4_lblk_t *block);
52 extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
53 extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
54 struct ext4_map_blocks *map, int flags);
55 --- a/fs/ext4/ialloc.c
56 +++ b/fs/ext4/ialloc.c
57 @@ -120,7 +120,7 @@ verified:
59 * Return buffer_head of bitmap on success or NULL.
61 -static struct buffer_head *
63 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
65 struct ext4_group_desc *desc;
66 @@ -213,6 +213,7 @@ out:
70 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
73 * NOTE! When we get the inode, we're the only people
76 @@ -6253,3 +6253,18 @@ int ext4_get_next_extent(struct inode *i
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);
98 #define NAMEI_RA_BLOCKS 4
99 #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
101 -static struct buffer_head *ext4_append(handle_t *handle,
102 +struct buffer_head *ext4_append(handle_t *handle,
106 @@ -159,6 +159,7 @@ static struct buffer_head *__ext4_read_d
110 +EXPORT_SYMBOL(ext4_append);
113 #define assert(test) J_ASSERT(test)
114 @@ -2392,7 +2393,7 @@ EXPORT_SYMBOL(ext4_delete_entry);
115 * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
116 * since this indicates that nlinks count was previously 1.
118 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
119 +void ext4_inc_count(handle_t *handle, struct inode *inode)
122 if (is_dx(inode) && inode->i_nlink > 1) {
123 @@ -2403,16 +2404,18 @@ static void ext4_inc_count(handle_t *han
127 +EXPORT_SYMBOL(ext4_inc_count);
130 * If a directory had nlink == 1, then we should let it be 1. This indicates
131 * directory has >EXT4_LINK_MAX subdirs.
133 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
134 +void ext4_dec_count(handle_t *handle, struct inode *inode)
136 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
139 +EXPORT_SYMBOL(ext4_dec_count);
142 static int ext4_add_nondir(handle_t *handle,
143 --- a/fs/ext4/super.c
144 +++ b/fs/ext4/super.c
145 @@ -326,11 +326,11 @@ static void __save_error_info(struct sup
147 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
148 es->s_last_error_time = cpu_to_le32(get_seconds());
149 - strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
150 + strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
151 es->s_last_error_line = cpu_to_le32(line);
152 if (!es->s_first_error_time) {
153 es->s_first_error_time = es->s_last_error_time;
154 - strncpy(es->s_first_error_func, func,
155 + strlcpy(es->s_first_error_func, func,
156 sizeof(es->s_first_error_func));
157 es->s_first_error_line = cpu_to_le32(line);
158 es->s_first_error_ino = es->s_last_error_ino;
159 @@ -5899,16 +5899,12 @@ static int __init ext4_init_fs(void)
160 err = init_inodecache();
163 - register_as_ext3();
164 - register_as_ext2();
165 err = register_filesystem(&ext4_fs_type);
171 - unregister_as_ext2();
172 - unregister_as_ext3();
173 destroy_inodecache();
176 @@ -5927,8 +5923,6 @@ out5:
177 static void __exit ext4_exit_fs(void)
179 ext4_destroy_lazyinit_thread();
180 - unregister_as_ext2();
181 - unregister_as_ext3();
182 unregister_filesystem(&ext4_fs_type);
183 destroy_inodecache();