1 commit b175e2441b0cd9fae60341ba92b0f7f192e71446
2 Author: girish <girish>
8 ext4 ldiskfs patches for rhel5
10 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
11 index 57169367362a..f3e369fc4dae 100644
14 @@ -2110,7 +2112,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
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 @@ -3570,6 +3586,13 @@ struct ext4_extent;
38 #define EXT_MAX_BLOCKS 0xffffffff
40 extern void ext4_ext_tree_init(handle_t *handle, struct inode *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(struct inode *inode);
44 +extern void ext4_dec_count(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 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
52 index 875af329c43e..646c00c81479 100644
53 --- a/fs/ext4/ialloc.c
54 +++ b/fs/ext4/ialloc.c
55 @@ -120,7 +120,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb,
57 * Return buffer_head of bitmap on success, or an ERR_PTR on error.
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 @@ -215,6 +215,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
68 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
71 * NOTE! When we get the inode, we're the only people
72 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
73 index e868b33ed8f5..70f3bb4ef5eb 100644
76 @@ -6215,3 +6215,20 @@ vm_fault_t ext4_filemap_fault(struct vm_fault *vmf)
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 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
98 index f4dd3a7ee965..708822bdbfc1 100644
100 +++ b/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 @@ -100,6 +100,8 @@ static struct buffer_head *ext4_append(handle_t *handle,
114 +#define assert(test) J_ASSERT(test)
116 static int ext4_dx_csum_verify(struct inode *inode,
117 struct ext4_dir_entry *dirent);
119 @@ -209,6 +211,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
123 +EXPORT_SYMBOL(ext4_append);
126 #define assert(test) J_ASSERT(test)
127 @@ -2626,23 +2629,25 @@ static int ext4_delete_entry(handle_t *handle,
128 * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
129 * on regular files) and to avoid creating huge/slow non-HTREE directories.
131 -static void ext4_inc_count(struct inode *inode)
132 +void ext4_inc_count(struct inode *inode)
136 (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
139 +EXPORT_SYMBOL(ext4_inc_count);
142 * If a directory had nlink == 1, then we should let it be 1. This indicates
143 * directory has >EXT4_LINK_MAX subdirs.
145 -static void ext4_dec_count(struct inode *inode)
146 +void ext4_dec_count(struct inode *inode)
148 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
151 +EXPORT_SYMBOL(ext4_dec_count);
155 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
156 index a461beea2aca..00437b8cd097 100644
157 --- a/fs/ext4/super.c
158 +++ b/fs/ext4/super.c
159 @@ -5607,7 +5607,7 @@ static void ext4_update_super(struct super_block *sb)
160 __ext4_update_tstamp(&es->s_first_error_time,
161 &es->s_first_error_time_hi,
162 sbi->s_first_error_time);
163 - strncpy(es->s_first_error_func, sbi->s_first_error_func,
164 + strlcpy(es->s_first_error_func, sbi->s_first_error_func,
165 sizeof(es->s_first_error_func));
166 es->s_first_error_line =
167 cpu_to_le32(sbi->s_first_error_line);
168 @@ -5621,7 +5621,7 @@ static void ext4_update_super(struct super_block *sb)
169 __ext4_update_tstamp(&es->s_last_error_time,
170 &es->s_last_error_time_hi,
171 sbi->s_last_error_time);
172 - strncpy(es->s_last_error_func, sbi->s_last_error_func,
173 + strlcpy(es->s_last_error_func, sbi->s_last_error_func,
174 sizeof(es->s_last_error_func));
175 es->s_last_error_line = cpu_to_le32(sbi->s_last_error_line);
176 es->s_last_error_ino = cpu_to_le32(sbi->s_last_error_ino);
177 @@ -6837,8 +6837,6 @@ static int __init ext4_init_fs(void)
181 - register_as_ext3();
182 - register_as_ext2();
183 err = register_filesystem(&ext4_fs_type);
186 @@ -6848,8 +6846,6 @@ static int __init ext4_init_fs(void)
187 printk(KERN_ERR "EXT4-fs: Cannot create netlink socket.\n");
190 - unregister_as_ext2();
191 - unregister_as_ext3();
192 ext4_fc_destroy_dentry_cache();
194 destroy_inodecache();
195 @@ -6874,8 +6870,6 @@ static int __init ext4_init_fs(void)
196 static void __exit ext4_exit_fs(void)
198 ext4_destroy_lazyinit_thread();
199 - unregister_as_ext2();
200 - unregister_as_ext3();
201 unregister_filesystem(&ext4_fs_type);
202 ext4_fc_destroy_dentry_cache();
203 destroy_inodecache();