Whamcloud - gitweb
LU-16847 ldiskfs: do not copy ldiskfs_chunk_trans_blocks
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles15sp4 / ext4-misc.patch
1 Subject: [PATCH] ext4-misc
2
3 ---
4  fs/ext4/ext4.h   | 25 ++++++++++++++++++++++++-
5  fs/ext4/ialloc.c |  3 ++-
6  fs/ext4/inode.c  | 16 ++++++++++++++++
7  fs/ext4/namei.c  |  9 ++++++---
8  fs/ext4/super.c  | 10 ++--------
9  fs/ext4/xattr.c  |  2 ++
10  6 files changed, 52 insertions(+), 13 deletions(-)
11
12 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
13 index 8d2c493..c96d89f 100644
14 --- a/fs/ext4/ext4.h
15 +++ b/fs/ext4/ext4.h
16 @@ -1913,6 +1913,8 @@ static inline bool ext4_verity_in_progress(struct inode *inode)
17  
18  #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
19  
20 +#define JOURNAL_START_HAS_3ARGS        1
21 +
22  /*
23   * Codes for operating systems
24   */
25 @@ -2152,7 +2154,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
26  
27  EXTN_FEATURE_FUNCS(2)
28  EXTN_FEATURE_FUNCS(3)
29 -EXTN_FEATURE_FUNCS(4)
30 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
31 +{
32 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
33 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
34 +}
35 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
36 +{
37 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
38 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
39 +}
40 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
41 +{
42 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
43 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
44 +}
45  
46  static inline bool ext4_has_compat_features(struct super_block *sb)
47  {
48 @@ -3687,6 +3703,13 @@ struct ext4_extent;
49  #define EXT_MAX_BLOCKS 0xffffffff
50  
51  extern void ext4_ext_tree_init(handle_t *handle, struct inode *inode);
52 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
53 +                                                 ext4_group_t block_group);
54 +extern void ext4_inc_count(struct inode *inode);
55 +extern void ext4_dec_count(struct inode *inode);
56 +extern struct buffer_head *ext4_append(handle_t *handle,
57 +                                      struct inode *inode,
58 +                                      ext4_lblk_t *block);
59  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
60  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
61                                struct ext4_map_blocks *map, int flags);
62 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
63 index 5d0a11d..4840190 100644
64 --- a/fs/ext4/ialloc.c
65 +++ b/fs/ext4/ialloc.c
66 @@ -120,7 +120,7 @@ verified:
67   *
68   * Return buffer_head of bitmap on success, or an ERR_PTR on error.
69   */
70 -static struct buffer_head *
71 +struct buffer_head *
72  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
73  {
74         struct ext4_group_desc *desc;
75 @@ -215,6 +215,7 @@ out:
76         put_bh(bh);
77         return ERR_PTR(err);
78  }
79 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
80  
81  /*
82   * NOTE! When we get the inode, we're the only people
83 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
84 index 06ee22e..bb109d9 100644
85 --- a/fs/ext4/inode.c
86 +++ b/fs/ext4/inode.c
87 @@ -6204,3 +6204,20 @@ out_error:
88         ext4_journal_stop(handle);
89         goto out;
90  }
91 +EXPORT_SYMBOL(ext4_map_blocks);
92 +EXPORT_SYMBOL(ext4_truncate);
93 +EXPORT_SYMBOL(ext4_iget);
94 +EXPORT_SYMBOL(ext4_bread);
95 +EXPORT_SYMBOL(ext4_itable_unused_count);
96 +EXPORT_SYMBOL(ext4_force_commit);
97 +EXPORT_SYMBOL(__ext4_mark_inode_dirty);
98 +EXPORT_SYMBOL(ext4_get_group_desc);
99 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
100 +EXPORT_SYMBOL(__ext4_journal_start_sb);
101 +EXPORT_SYMBOL(__ext4_journal_stop);
102 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
103 +EXPORT_SYMBOL(__ext4_std_error);
104 +EXPORT_SYMBOL(ext4fs_dirhash);
105 +EXPORT_SYMBOL(ext4_get_inode_loc);
106 +EXPORT_SYMBOL(__ext4_journal_ensure_credits);
107 +EXPORT_SYMBOL(ext4_chunk_trans_blocks);
108 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
109 index 0d5b8ea..f207dd5 100644
110 --- a/fs/ext4/namei.c
111 +++ b/fs/ext4/namei.c
112 @@ -50,7 +50,7 @@
113  #define NAMEI_RA_BLOCKS  4
114  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
115  
116 -static struct buffer_head *ext4_append(handle_t *handle,
117 +struct buffer_head *ext4_append(handle_t *handle,
118                                         struct inode *inode,
119                                         ext4_lblk_t *block)
120  {
121 @@ -205,6 +205,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
122         }
123         return bh;
124  }
125 +EXPORT_SYMBOL(ext4_append);
126  
127  #ifdef DX_DEBUG
128  #define dxtrace(command) command
129 @@ -2753,23 +2754,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
130   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
131   * on regular files) and to avoid creating huge/slow non-HTREE directories.
132   */
133 -static void ext4_inc_count(struct inode *inode)
134 +void ext4_inc_count(struct inode *inode)
135  {
136         inc_nlink(inode);
137         if (is_dx(inode) &&
138             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
139                 set_nlink(inode, 1);
140  }
141 +EXPORT_SYMBOL(ext4_inc_count);
142  
143  /*
144   * If a directory had nlink == 1, then we should let it be 1. This indicates
145   * directory has >EXT4_LINK_MAX subdirs.
146   */
147 -static void ext4_dec_count(struct inode *inode)
148 +void ext4_dec_count(struct inode *inode)
149  {
150         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
151                 drop_nlink(inode);
152  }
153 +EXPORT_SYMBOL(ext4_dec_count);
154  
155  
156  /*
157 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
158 index 7b5df25..4be1994 100644
159 --- a/fs/ext4/super.c
160 +++ b/fs/ext4/super.c
161 @@ -5605,7 +5605,7 @@ static void ext4_update_super(struct super_block *sb)
162                         __ext4_update_tstamp(&es->s_first_error_time,
163                                              &es->s_first_error_time_hi,
164                                              sbi->s_first_error_time);
165 -                       strncpy(es->s_first_error_func, sbi->s_first_error_func,
166 +                       strlcpy(es->s_first_error_func, sbi->s_first_error_func,
167                                 sizeof(es->s_first_error_func));
168                         es->s_first_error_line =
169                                 cpu_to_le32(sbi->s_first_error_line);
170 @@ -5619,7 +5619,7 @@ static void ext4_update_super(struct super_block *sb)
171                 __ext4_update_tstamp(&es->s_last_error_time,
172                                      &es->s_last_error_time_hi,
173                                      sbi->s_last_error_time);
174 -               strncpy(es->s_last_error_func, sbi->s_last_error_func,
175 +               strlcpy(es->s_last_error_func, sbi->s_last_error_func,
176                         sizeof(es->s_last_error_func));
177                 es->s_last_error_line = cpu_to_le32(sbi->s_last_error_line);
178                 es->s_last_error_ino = cpu_to_le32(sbi->s_last_error_ino);
179 @@ -6826,16 +6826,12 @@ static int __init ext4_init_fs(void)
180         if (err)
181                 goto out05;
182  
183 -       register_as_ext3();
184 -       register_as_ext2();
185         err = register_filesystem(&ext4_fs_type);
186         if (err)
187                 goto out;
188  
189         return 0;
190  out:
191 -       unregister_as_ext2();
192 -       unregister_as_ext3();
193         ext4_fc_destroy_dentry_cache();
194  out05:
195         destroy_inodecache();
196 @@ -6860,8 +6856,6 @@ out7:
197  static void __exit ext4_exit_fs(void)
198  {
199         ext4_destroy_lazyinit_thread();
200 -       unregister_as_ext2();
201 -       unregister_as_ext3();
202         unregister_filesystem(&ext4_fs_type);
203         ext4_fc_destroy_dentry_cache();
204         destroy_inodecache();
205 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
206 index f9b4602..f5af950 100644
207 --- a/fs/ext4/xattr.c
208 +++ b/fs/ext4/xattr.c
209 @@ -671,6 +671,7 @@ ext4_xattr_get(struct inode *inode, int name_index, const char *name,
210         up_read(&EXT4_I(inode)->xattr_sem);
211         return error;
212  }
213 +EXPORT_SYMBOL(ext4_xattr_get);
214  
215  static int
216  ext4_xattr_list_entries(struct dentry *dentry, struct ext4_xattr_entry *entry,
217 @@ -2430,6 +2431,7 @@ cleanup:
218         ext4_write_unlock_xattr(inode, &no_expand);
219         return error;
220  }
221 +EXPORT_SYMBOL(ext4_xattr_set_handle);
222  
223  int ext4_xattr_set_credits(struct inode *inode, size_t value_len,
224                            bool is_create, int *credits)
225 -- 
226 2.34.1
227