2 fs/ext4/ext4.h | 25 ++++++++++++++++++++++++-
3 fs/ext4/ialloc.c | 3 ++-
4 fs/ext4/inode.c | 16 ++++++++++++++++
5 fs/ext4/namei.c | 9 ++++++---
6 fs/ext4/super.c | 10 ++--------
7 5 files changed, 50 insertions(+), 13 deletions(-)
9 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
10 index 2c8b1ae..1d80381 100644
13 @@ -2089,7 +2091,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
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 @@ -3554,6 +3570,13 @@ struct ext4_extent;
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 --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
51 index 221d849..e83c30e 100644
52 --- a/fs/ext4/ialloc.c
53 +++ b/fs/ext4/ialloc.c
54 @@ -120,7 +120,7 @@ verified:
56 * Return buffer_head of bitmap on success, or an ERR_PTR on error.
58 -static struct buffer_head *
60 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
62 struct ext4_group_desc *desc;
63 @@ -215,6 +215,7 @@ out:
67 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
70 * NOTE! When we get the inode, we're the only people
71 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
72 index ea9976b..e3630b0 100644
75 @@ -6206,3 +6206,20 @@ vm_fault_t ext4_filemap_fault(struct vm_fault *vmf)
79 +EXPORT_SYMBOL(ext4_map_blocks);
80 +EXPORT_SYMBOL(ext4_truncate);
81 +EXPORT_SYMBOL(ext4_iget);
82 +EXPORT_SYMBOL(ext4_bread);
83 +EXPORT_SYMBOL(ext4_itable_unused_count);
84 +EXPORT_SYMBOL(ext4_force_commit);
85 +EXPORT_SYMBOL(__ext4_mark_inode_dirty);
86 +EXPORT_SYMBOL(ext4_get_group_desc);
87 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
88 +EXPORT_SYMBOL(__ext4_journal_start_sb);
89 +EXPORT_SYMBOL(__ext4_journal_stop);
90 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
91 +EXPORT_SYMBOL(__ext4_std_error);
92 +EXPORT_SYMBOL(ext4fs_dirhash);
93 +EXPORT_SYMBOL(ext4_get_inode_loc);
94 +EXPORT_SYMBOL(__ext4_journal_ensure_credits);
95 +EXPORT_SYMBOL(ext4_chunk_trans_blocks);
96 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
97 index f09b60b..ff6c251 100644
101 #define NAMEI_RA_BLOCKS 4
102 #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
104 -static struct buffer_head *ext4_append(handle_t *handle,
105 +struct buffer_head *ext4_append(handle_t *handle,
109 @@ -181,6 +181,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
113 +EXPORT_SYMBOL(ext4_append);
116 #define assert(test) J_ASSERT(test)
117 @@ -2578,23 +2579,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
118 * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
119 * on regular files) and to avoid creating huge/slow non-HTREE directories.
121 -static void ext4_inc_count(struct inode *inode)
122 +void ext4_inc_count(struct inode *inode)
126 (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
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(struct inode *inode)
136 +void ext4_dec_count(struct inode *inode)
138 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
141 +EXPORT_SYMBOL(ext4_dec_count);
145 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
146 index ea5aefa..056009e 100644
147 --- a/fs/ext4/super.c
148 +++ b/fs/ext4/super.c
149 @@ -435,7 +435,7 @@ static void __save_error_info(struct super_block *sb, int error,
151 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
152 ext4_update_tstamp(es, s_last_error_time);
153 - strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
154 + strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
155 es->s_last_error_line = cpu_to_le32(line);
156 es->s_last_error_ino = cpu_to_le32(ino);
157 es->s_last_error_block = cpu_to_le64(block);
158 @@ -496,7 +496,7 @@ static void __save_error_info(struct super_block *sb, int error,
159 if (!es->s_first_error_time) {
160 es->s_first_error_time = es->s_last_error_time;
161 es->s_first_error_time_hi = es->s_last_error_time_hi;
162 - strncpy(es->s_first_error_func, func,
163 + strlcpy(es->s_first_error_func, func,
164 sizeof(es->s_first_error_func));
165 es->s_first_error_line = cpu_to_le32(line);
166 es->s_first_error_ino = es->s_last_error_ino;
167 @@ -6673,16 +6673,12 @@ static int __init ext4_init_fs(void)
171 - register_as_ext3();
172 - register_as_ext2();
173 err = register_filesystem(&ext4_fs_type);
179 - unregister_as_ext2();
180 - unregister_as_ext3();
182 destroy_inodecache();
184 @@ -6706,8 +6702,6 @@ out7:
185 static void __exit ext4_exit_fs(void)
187 ext4_destroy_lazyinit_thread();
188 - unregister_as_ext2();
189 - unregister_as_ext3();
190 unregister_filesystem(&ext4_fs_type);
191 destroy_inodecache();