Whamcloud - gitweb
LU-13437 lmv: check stripe FID sanity
[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,11 @@ 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 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:
58   *
59   * Return buffer_head of bitmap on success or NULL.
60   */
61 -static struct buffer_head *
62 +struct buffer_head *
63  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
64  {
65         struct ext4_group_desc *desc;
66 @@ -213,6 +213,7 @@ out:
67         put_bh(bh);
68         return ERR_PTR(err);
69  }
70 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
71  
72  /*
73   * NOTE! When we get the inode, we're the only people
74 --- a/fs/ext4/inode.c
75 +++ b/fs/ext4/inode.c
76 @@ -6253,3 +6253,18 @@ int ext4_get_next_extent(struct inode *i
77         result->es_len = 0;
78         return 0;
79  }
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 --- a/fs/ext4/namei.c
96 +++ b/fs/ext4/namei.c
97 @@ -48,7 +48,7 @@
98  #define NAMEI_RA_BLOCKS  4
99  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
100  
101 -static struct buffer_head *ext4_append(handle_t *handle,
102 +struct buffer_head *ext4_append(handle_t *handle,
103                                         struct inode *inode,
104                                         ext4_lblk_t *block)
105  {
106 @@ -159,6 +159,7 @@ static struct buffer_head *__ext4_read_d
107         }
108         return bh;
109  }
110 +EXPORT_SYMBOL(ext4_append);
111  
112  #ifndef assert
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.
117   */
118 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
119 +void ext4_inc_count(handle_t *handle, struct inode *inode)
120  {
121         inc_nlink(inode);
122         if (is_dx(inode) && inode->i_nlink > 1) {
123 @@ -2403,16 +2404,18 @@ static void ext4_inc_count(handle_t *han
124                 }
125         }
126  }
127 +EXPORT_SYMBOL(ext4_inc_count);
128  
129  /*
130   * If a directory had nlink == 1, then we should let it be 1. This indicates
131   * directory has >EXT4_LINK_MAX subdirs.
132   */
133 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
134 +void ext4_dec_count(handle_t *handle, struct inode *inode)
135  {
136         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
137                 drop_nlink(inode);
138  }
139 +EXPORT_SYMBOL(ext4_dec_count);
140  
141  
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
146                 return;
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();
161         if (err)
162                 goto out1;
163 -       register_as_ext3();
164 -       register_as_ext2();
165         err = register_filesystem(&ext4_fs_type);
166         if (err)
167                 goto out;
168  
169         return 0;
170  out:
171 -       unregister_as_ext2();
172 -       unregister_as_ext3();
173         destroy_inodecache();
174  out1:
175         ext4_exit_mballoc();
176 @@ -5927,8 +5923,6 @@ out5:
177  static void __exit ext4_exit_fs(void)
178  {
179         ext4_destroy_lazyinit_thread();
180 -       unregister_as_ext2();
181 -       unregister_as_ext3();
182         unregister_filesystem(&ext4_fs_type);
183         destroy_inodecache();
184         ext4_exit_mballoc();