Whamcloud - gitweb
LU-15635 ldiskfs: Interface change fix server v5.10
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles15sp1 / ext4-misc.patch
1 ---
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(-)
8
9 --- a/fs/ext4/ext4.h
10 +++ b/fs/ext4/ext4.h
11 @@ -1630,6 +1630,8 @@ static inline void ext4_clear_state_flag
12   */
13  #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
14  
15 +#define JOURNAL_START_HAS_3ARGS        1
16 +
17  /*
18   * Codes for operating systems
19   */
20 @@ -1842,7 +1844,21 @@ static inline bool ext4_has_unknown_ext#
21  
22  EXTN_FEATURE_FUNCS(2)
23  EXTN_FEATURE_FUNCS(3)
24 -EXTN_FEATURE_FUNCS(4)
25 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
26 +{
27 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
28 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
29 +}
30 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
31 +{
32 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
33 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
34 +}
35 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
36 +{
37 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
38 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
39 +}
40  
41  static inline bool ext4_has_compat_features(struct super_block *sb)
42  {
43 @@ -3133,6 +3149,13 @@ struct ext4_extent;
44  
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:
60   *
61   * Return buffer_head of bitmap on success or NULL.
62   */
63 -static struct buffer_head *
64 +struct buffer_head *
65  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
66  {
67         struct ext4_group_desc *desc;
68 @@ -213,6 +213,7 @@ out:
69         put_bh(bh);
70         return ERR_PTR(err);
71  }
72 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
73  
74  /*
75   * NOTE! When we get the inode, we're the only people
76 --- a/fs/ext4/inode.c
77 +++ b/fs/ext4/inode.c
78 @@ -6253,3 +6253,18 @@ int ext4_get_next_extent(struct inode *i
79         result->es_len = 0;
80         return 0;
81  }
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);
97 --- a/fs/ext4/namei.c
98 +++ b/fs/ext4/namei.c
99 @@ -48,7 +48,7 @@
100  #define NAMEI_RA_BLOCKS  4
101  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
102  
103 -static struct buffer_head *ext4_append(handle_t *handle,
104 +struct buffer_head *ext4_append(handle_t *handle,
105                                         struct inode *inode,
106                                         ext4_lblk_t *block)
107  {
108 @@ -159,6 +159,7 @@ static struct buffer_head *__ext4_read_d
109         }
110         return bh;
111  }
112 +EXPORT_SYMBOL(ext4_append);
113  
114  #ifndef assert
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.
119   */
120 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
121 +void ext4_inc_count(handle_t *handle, struct inode *inode)
122  {
123         inc_nlink(inode);
124         if (is_dx(inode) && inode->i_nlink > 1) {
125 @@ -2403,16 +2404,18 @@ static void ext4_inc_count(handle_t *han
126                 }
127         }
128  }
129 +EXPORT_SYMBOL(ext4_inc_count);
130  
131  /*
132   * If a directory had nlink == 1, then we should let it be 1. This indicates
133   * directory has >EXT4_LINK_MAX subdirs.
134   */
135 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
136 +void ext4_dec_count(handle_t *handle, struct inode *inode)
137  {
138         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
139                 drop_nlink(inode);
140  }
141 +EXPORT_SYMBOL(ext4_dec_count);
142  
143  
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
148                 return;
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();
163         if (err)
164                 goto out1;
165 -       register_as_ext3();
166 -       register_as_ext2();
167         err = register_filesystem(&ext4_fs_type);
168         if (err)
169                 goto out;
170  
171         return 0;
172  out:
173 -       unregister_as_ext2();
174 -       unregister_as_ext3();
175         destroy_inodecache();
176  out1:
177         ext4_exit_mballoc();
178 @@ -5927,8 +5923,6 @@ out5:
179  static void __exit ext4_exit_fs(void)
180  {
181         ext4_destroy_lazyinit_thread();
182 -       unregister_as_ext2();
183 -       unregister_as_ext3();
184         unregister_filesystem(&ext4_fs_type);
185         destroy_inodecache();
186         ext4_exit_mballoc();