Whamcloud - gitweb
5e142056866ceaa5fbb81f721560f1899b1c3b8c
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / linux-5.10 / ext4-misc.patch
1 ---
2  fs/ext4/ext4.h   | 25 ++++++++++++++++++++++++-
3  fs/ext4/ialloc.c |  3 ++-
4  fs/ext4/inode.c  | 16 ++++++++++++++++
5  fs/ext4/namei.c  |  9 ++++++---
6  fs/ext4/super.c  | 10 ++--------
7  5 files changed, 50 insertions(+), 13 deletions(-)
8
9 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
10 index 2c8b1ae..1d80381 100644
11 --- a/fs/ext4/ext4.h
12 +++ b/fs/ext4/ext4.h
13 @@ -2089,7 +2091,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
14  
15  EXTN_FEATURE_FUNCS(2)
16  EXTN_FEATURE_FUNCS(3)
17 -EXTN_FEATURE_FUNCS(4)
18 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
19 +{
20 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
21 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
22 +}
23 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
24 +{
25 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
26 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
27 +}
28 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
29 +{
30 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
31 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
32 +}
33  
34  static inline bool ext4_has_compat_features(struct super_block *sb)
35  {
36 @@ -3554,6 +3570,13 @@ struct ext4_extent;
37  #define EXT_MAX_BLOCKS 0xffffffff
38  
39  extern void ext4_ext_tree_init(handle_t *handle, struct inode *inode);
40 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
41 +                                                 ext4_group_t block_group);
42 +extern void ext4_inc_count(struct inode *inode);
43 +extern void ext4_dec_count(struct inode *inode);
44 +extern struct buffer_head *ext4_append(handle_t *handle,
45 +                                      struct inode *inode,
46 +                                      ext4_lblk_t *block);
47  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
48  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
49                                struct ext4_map_blocks *map, int flags);
50 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
51 index 221d849..e83c30e 100644
52 --- a/fs/ext4/ialloc.c
53 +++ b/fs/ext4/ialloc.c
54 @@ -120,7 +120,7 @@ verified:
55   *
56   * Return buffer_head of bitmap on success, or an ERR_PTR on error.
57   */
58 -static struct buffer_head *
59 +struct buffer_head *
60  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
61  {
62         struct ext4_group_desc *desc;
63 @@ -215,6 +215,7 @@ out:
64         put_bh(bh);
65         return ERR_PTR(err);
66  }
67 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
68  
69  /*
70   * NOTE! When we get the inode, we're the only people
71 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
72 index ea9976b..e3630b0 100644
73 --- a/fs/ext4/inode.c
74 +++ b/fs/ext4/inode.c
75 @@ -6206,3 +6206,20 @@ vm_fault_t ext4_filemap_fault(struct vm_fault *vmf)
76  
77         return ret;
78  }
79 +EXPORT_SYMBOL(ext4_map_blocks);
80 +EXPORT_SYMBOL(ext4_truncate);
81 +EXPORT_SYMBOL(ext4_iget);
82 +EXPORT_SYMBOL(ext4_bread);
83 +EXPORT_SYMBOL(ext4_itable_unused_count);
84 +EXPORT_SYMBOL(ext4_force_commit);
85 +EXPORT_SYMBOL(__ext4_mark_inode_dirty);
86 +EXPORT_SYMBOL(ext4_get_group_desc);
87 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
88 +EXPORT_SYMBOL(__ext4_journal_start_sb);
89 +EXPORT_SYMBOL(__ext4_journal_stop);
90 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
91 +EXPORT_SYMBOL(__ext4_std_error);
92 +EXPORT_SYMBOL(ext4fs_dirhash);
93 +EXPORT_SYMBOL(ext4_get_inode_loc);
94 +EXPORT_SYMBOL(__ext4_journal_ensure_credits);
95 +EXPORT_SYMBOL(ext4_chunk_trans_blocks);
96 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
97 index f09b60b..ff6c251 100644
98 --- a/fs/ext4/namei.c
99 +++ b/fs/ext4/namei.c
100 @@ -50,7 +50,7 @@
101  #define NAMEI_RA_BLOCKS  4
102  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
103  
104 -static struct buffer_head *ext4_append(handle_t *handle,
105 +struct buffer_head *ext4_append(handle_t *handle,
106                                         struct inode *inode,
107                                         ext4_lblk_t *block)
108  {
109 @@ -181,6 +181,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
110         }
111         return bh;
112  }
113 +EXPORT_SYMBOL(ext4_append);
114  
115  #ifndef assert
116  #define assert(test) J_ASSERT(test)
117 @@ -2578,23 +2579,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
118   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
119   * on regular files) and to avoid creating huge/slow non-HTREE directories.
120   */
121 -static void ext4_inc_count(struct inode *inode)
122 +void ext4_inc_count(struct inode *inode)
123  {
124         inc_nlink(inode);
125         if (is_dx(inode) &&
126             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
127                 set_nlink(inode, 1);
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(struct inode *inode)
136 +void ext4_dec_count(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  /*
145 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
146 index ea5aefa..056009e 100644
147 --- a/fs/ext4/super.c
148 +++ b/fs/ext4/super.c
149 @@ -435,7 +435,7 @@ static void __save_error_info(struct super_block *sb, int error,
150                 return;
151         es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
152         ext4_update_tstamp(es, s_last_error_time);
153 -       strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
154 +       strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
155         es->s_last_error_line = cpu_to_le32(line);
156         es->s_last_error_ino = cpu_to_le32(ino);
157         es->s_last_error_block = cpu_to_le64(block);
158 @@ -496,7 +496,7 @@ static void __save_error_info(struct super_block *sb, int error,
159         if (!es->s_first_error_time) {
160                 es->s_first_error_time = es->s_last_error_time;
161                 es->s_first_error_time_hi = es->s_last_error_time_hi;
162 -               strncpy(es->s_first_error_func, func,
163 +               strlcpy(es->s_first_error_func, func,
164                         sizeof(es->s_first_error_func));
165                 es->s_first_error_line = cpu_to_le32(line);
166                 es->s_first_error_ino = es->s_last_error_ino;
167 @@ -6673,16 +6673,12 @@ static int __init ext4_init_fs(void)
168         if (err)
169                 goto out05;
170  
171 -       register_as_ext3();
172 -       register_as_ext2();
173         err = register_filesystem(&ext4_fs_type);
174         if (err)
175                 goto out;
176  
177         return 0;
178  out:
179 -       unregister_as_ext2();
180 -       unregister_as_ext3();
181  out05:
182         destroy_inodecache();
183  out1:
184 @@ -6706,8 +6702,6 @@ out7:
185  static void __exit ext4_exit_fs(void)
186  {
187         ext4_destroy_lazyinit_thread();
188 -       unregister_as_ext2();
189 -       unregister_as_ext3();
190         unregister_filesystem(&ext4_fs_type);
191         destroy_inodecache();
192         ext4_exit_mballoc();