Whamcloud - gitweb
LU-12477 ldiskfs: drop SUSE kernel 4.4 and earlier
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles15sp1 / ext4-misc.patch
diff --git a/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch b/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch
new file mode 100644 (file)
index 0000000..395ef2c
--- /dev/null
@@ -0,0 +1,184 @@
+---
+ fs/ext4/ext4.h   |   23 ++++++++++++++++++++++-
+ fs/ext4/ialloc.c |    3 ++-
+ fs/ext4/inode.c  |   15 +++++++++++++++
+ fs/ext4/namei.c  |    9 ++++++---
+ fs/ext4/super.c  |   10 ++--------
+ 5 files changed, 47 insertions(+), 13 deletions(-)
+
+--- a/fs/ext4/ext4.h
++++ b/fs/ext4/ext4.h
+@@ -1630,6 +1630,8 @@ static inline void ext4_clear_state_flag
+  */
+ #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
++#define JOURNAL_START_HAS_3ARGS       1
++
+ /*
+  * Codes for operating systems
+  */
+@@ -1842,7 +1844,21 @@ static inline bool ext4_has_unknown_ext#
+ EXTN_FEATURE_FUNCS(2)
+ EXTN_FEATURE_FUNCS(3)
+-EXTN_FEATURE_FUNCS(4)
++static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
++{
++      return ((EXT4_SB(sb)->s_es->s_feature_compat &
++              cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
++}
++static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
++{
++      return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
++              cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
++}
++static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
++{
++      return ((EXT4_SB(sb)->s_es->s_feature_incompat &
++              cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
++}
+ static inline bool ext4_has_compat_features(struct super_block *sb)
+ {
+@@ -3133,6 +3149,11 @@ struct ext4_extent;
+ extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
+ extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
++extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
++                                                ext4_group_t block_group);
++extern struct buffer_head *ext4_append(handle_t *handle,
++                                     struct inode *inode,
++                                     ext4_lblk_t *block);
+ extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
+ extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
+                              struct ext4_map_blocks *map, int flags);
+--- a/fs/ext4/ialloc.c
++++ b/fs/ext4/ialloc.c
+@@ -120,7 +120,7 @@ verified:
+  *
+  * Return buffer_head of bitmap on success or NULL.
+  */
+-static struct buffer_head *
++struct buffer_head *
+ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
+ {
+       struct ext4_group_desc *desc;
+@@ -213,6 +213,7 @@ out:
+       put_bh(bh);
+       return ERR_PTR(err);
+ }
++EXPORT_SYMBOL(ext4_read_inode_bitmap);
+ /*
+  * NOTE! When we get the inode, we're the only people
+--- a/fs/ext4/inode.c
++++ b/fs/ext4/inode.c
+@@ -6253,3 +6253,18 @@ int ext4_get_next_extent(struct inode *i
+       result->es_len = 0;
+       return 0;
+ }
++EXPORT_SYMBOL(ext4_map_blocks);
++EXPORT_SYMBOL(ext4_truncate);
++EXPORT_SYMBOL(__ext4_iget);
++EXPORT_SYMBOL(ext4_bread);
++EXPORT_SYMBOL(ext4_itable_unused_count);
++EXPORT_SYMBOL(ext4_force_commit);
++EXPORT_SYMBOL(ext4_mark_inode_dirty);
++EXPORT_SYMBOL(ext4_get_group_desc);
++EXPORT_SYMBOL(__ext4_journal_get_write_access);
++EXPORT_SYMBOL(__ext4_journal_start_sb);
++EXPORT_SYMBOL(__ext4_journal_stop);
++EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
++EXPORT_SYMBOL(__ext4_std_error);
++EXPORT_SYMBOL(ext4fs_dirhash);
++EXPORT_SYMBOL(ext4_get_inode_loc);
+--- a/fs/ext4/namei.c
++++ b/fs/ext4/namei.c
+@@ -48,7 +48,7 @@
+ #define NAMEI_RA_BLOCKS  4
+ #define NAMEI_RA_SIZE      (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
+-static struct buffer_head *ext4_append(handle_t *handle,
++struct buffer_head *ext4_append(handle_t *handle,
+                                       struct inode *inode,
+                                       ext4_lblk_t *block)
+ {
+@@ -159,6 +159,7 @@ static struct buffer_head *__ext4_read_d
+       }
+       return bh;
+ }
++EXPORT_SYMBOL(ext4_append);
+ #ifndef assert
+ #define assert(test) J_ASSERT(test)
+@@ -2392,7 +2393,7 @@ EXPORT_SYMBOL(ext4_delete_entry);
+  * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
+  * since this indicates that nlinks count was previously 1.
+  */
+-static void ext4_inc_count(handle_t *handle, struct inode *inode)
++void ext4_inc_count(handle_t *handle, struct inode *inode)
+ {
+       inc_nlink(inode);
+       if (is_dx(inode) && inode->i_nlink > 1) {
+@@ -2403,16 +2404,18 @@ static void ext4_inc_count(handle_t *han
+               }
+       }
+ }
++EXPORT_SYMBOL(ext4_inc_count);
+ /*
+  * If a directory had nlink == 1, then we should let it be 1. This indicates
+  * directory has >EXT4_LINK_MAX subdirs.
+  */
+-static void ext4_dec_count(handle_t *handle, struct inode *inode)
++void ext4_dec_count(handle_t *handle, struct inode *inode)
+ {
+       if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
+               drop_nlink(inode);
+ }
++EXPORT_SYMBOL(ext4_dec_count);
+ static int ext4_add_nondir(handle_t *handle,
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -326,11 +326,11 @@ static void __save_error_info(struct sup
+               return;
+       es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
+       es->s_last_error_time = cpu_to_le32(get_seconds());
+-      strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
++      strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
+       es->s_last_error_line = cpu_to_le32(line);
+       if (!es->s_first_error_time) {
+               es->s_first_error_time = es->s_last_error_time;
+-              strncpy(es->s_first_error_func, func,
++              strlcpy(es->s_first_error_func, func,
+                       sizeof(es->s_first_error_func));
+               es->s_first_error_line = cpu_to_le32(line);
+               es->s_first_error_ino = es->s_last_error_ino;
+@@ -5899,16 +5899,12 @@ static int __init ext4_init_fs(void)
+       err = init_inodecache();
+       if (err)
+               goto out1;
+-      register_as_ext3();
+-      register_as_ext2();
+       err = register_filesystem(&ext4_fs_type);
+       if (err)
+               goto out;
+       return 0;
+ out:
+-      unregister_as_ext2();
+-      unregister_as_ext3();
+       destroy_inodecache();
+ out1:
+       ext4_exit_mballoc();
+@@ -5927,8 +5923,6 @@ out5:
+ static void __exit ext4_exit_fs(void)
+ {
+       ext4_destroy_lazyinit_thread();
+-      unregister_as_ext2();
+-      unregister_as_ext3();
+       unregister_filesystem(&ext4_fs_type);
+       destroy_inodecache();
+       ext4_exit_mballoc();