Whamcloud - gitweb
56d0db3e71e7fcc2cf1fa88b3192921c33cc1073
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / linux-5.8 / 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 @@ -1759,6 +1759,8 @@ static inline bool ext4_verity_in_progre
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 @@ -1990,7 +1992,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 @@ -3393,6 +3409,11 @@ struct ext4_extent;
44  #define EXT_MAX_BLOCKS 0xffffffff
45  
46  extern void ext4_ext_tree_init(handle_t *handle, struct inode *inode);
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 @@ -115,7 +115,7 @@ verified:
58   *
59   * Return buffer_head of bitmap on success, or an ERR_PTR on error.
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 @@ -6065,3 +6065,18 @@ vm_fault_t ext4_filemap_fault(struct vm_
77  
78         return ret;
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 @@ -50,7 +50,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 @@ -181,6 +181,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 @@ -2572,23 +2573,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
115   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
116   * on regular files) and to avoid creating huge/slow non-HTREE directories.
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) &&
123             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
124                 set_nlink(inode, 1);
125  }
126 +EXPORT_SYMBOL(ext4_inc_count);
127  
128  /*
129   * If a directory had nlink == 1, then we should let it be 1. This indicates
130   * directory has >EXT4_LINK_MAX subdirs.
131   */
132 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
133 +void ext4_dec_count(handle_t *handle, struct inode *inode)
134  {
135         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
136                 drop_nlink(inode);
137  }
138 +EXPORT_SYMBOL(ext4_dec_count);
139  
140  
141  /*
142 --- a/fs/ext4/super.c
143 +++ b/fs/ext4/super.c
144 @@ -347,7 +347,7 @@ static void __save_error_info(struct sup
145                 return;
146         es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
147         ext4_update_tstamp(es, s_last_error_time);
148 -       strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
149 +       strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
150         es->s_last_error_line = cpu_to_le32(line);
151         es->s_last_error_ino = cpu_to_le32(ino);
152         es->s_last_error_block = cpu_to_le64(block);
153 @@ -408,7 +408,7 @@ static void __save_error_info(struct sup
154         if (!es->s_first_error_time) {
155                 es->s_first_error_time = es->s_last_error_time;
156                 es->s_first_error_time_hi = es->s_last_error_time_hi;
157 -               strncpy(es->s_first_error_func, func,
158 +               strlcpy(es->s_first_error_func, func,
159                         sizeof(es->s_first_error_func));
160                 es->s_first_error_line = cpu_to_le32(line);
161                 es->s_first_error_ino = es->s_last_error_ino;
162 @@ -6315,16 +6315,12 @@ static int __init ext4_init_fs(void)
163         err = init_inodecache();
164         if (err)
165                 goto out1;
166 -       register_as_ext3();
167 -       register_as_ext2();
168         err = register_filesystem(&ext4_fs_type);
169         if (err)
170                 goto out;
171  
172         return 0;
173  out:
174 -       unregister_as_ext2();
175 -       unregister_as_ext3();
176         destroy_inodecache();
177  out1:
178         ext4_exit_mballoc();
179 @@ -6347,8 +6343,6 @@ out7:
180  static void __exit ext4_exit_fs(void)
181  {
182         ext4_destroy_lazyinit_thread();
183 -       unregister_as_ext2();
184 -       unregister_as_ext3();
185         unregister_filesystem(&ext4_fs_type);
186         destroy_inodecache();
187         ext4_exit_mballoc();