From 2349425bf4c2669e14566820a37dfb0930761e75 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 4 Mar 2024 20:10:58 -0700 Subject: [PATCH] LU-17606 ldiskfs: remove old compatibility code The JOURNAL_START_HAS_3ARGS and EXT4_HT_MISC checks are always true for kernels since 3.10, and no longer have any value to keep around. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I39333026b1f24c3d60fbc3f8c51be693353ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54274 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Artem Blagodarenko Reviewed-by: Li Dongyang --- config/lustre-build-ldiskfs.m4 | 23 --------------- .../patches/linux-5.10/ext4-misc.patch | 9 ------ .../patches/linux-5.16/ext4-misc.patch | 9 ------ .../patches/linux-5.8/ext4-misc.patch | 9 ------ .../kernel_patches/patches/oe2203/ext4-misc.patch | 9 ------ .../kernel_patches/patches/rhel8.7/ext4-misc.patch | 9 ------ .../patches/sles15sp1/ext4-misc.patch | 9 ------ .../patches/sles15sp4/ext4-misc.patch | 9 ------ .../kernel_patches/patches/suse15/ext4-misc.patch | 9 ------ .../patches/ubuntu20.04.3/ext4-misc.patch | 9 ------ .../patches/ubuntu2004/ext4-misc.patch | 9 ------ lustre/osd-ldiskfs/osd_internal.h | 34 ---------------------- 12 files changed, 147 deletions(-) diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 index 7d40823..842a237 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 @@ -218,27 +218,6 @@ AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD], [ ]) # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD # -# LB_EXT4_JOURNAL_START_3ARGS -# -# 3.9 added a type argument to ext4_journal_start and friends -# -AC_DEFUN([LB_SRC_EXT4_JOURNAL_START_3ARGS], [ - LB2_LINUX_TEST_SRC([ext4_journal_start], [ - #include - #include "$EXT4_SRC_DIR/ext4_jbd2.h" - ],[ - ext4_journal_start(NULL, 0, 0); - ],[],[],[__ext4_journal_start_sb]) -]) -AC_DEFUN([LB_EXT4_JOURNAL_START_3ARGS], [ - LB2_MSG_LINUX_TEST_RESULT([if ext4_journal_start takes 3 arguments], - [ext4_journal_start], [ - AC_DEFINE(JOURNAL_START_HAS_3ARGS, 1, - [ext4_journal_start takes 3 arguments]) - ]) -]) # LB_EXT4_JOURNAL_START_3ARGS - -# # LB_EXT4_BREAD_4ARGS # # 3.18 ext4_bread has 4 arguments @@ -675,7 +654,6 @@ AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes]) AS_IF([test x$enable_ldiskfs != xno],[ AC_DEFUN([LB_EXT4_SRC_DIR_SRC],[ LB_SRC_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD - LB_SRC_EXT4_JOURNAL_START_3ARGS LB_SRC_EXT4_BREAD_4ARGS LB_SRC_EXT4_HAVE_INFO_DQUOT LB_SRC_EXT4_HAVE_I_CRYPT_INFO @@ -689,7 +667,6 @@ AS_IF([test x$enable_ldiskfs != xno],[ ]) AC_DEFUN([LB_EXT4_SRC_DIR_RESULTS], [ LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD - LB_EXT4_JOURNAL_START_3ARGS LB_EXT4_BREAD_4ARGS LB_EXT4_HAVE_INFO_DQUOT LB_EXT4_HAVE_I_CRYPT_INFO diff --git a/ldiskfs/kernel_patches/patches/linux-5.10/ext4-misc.patch b/ldiskfs/kernel_patches/patches/linux-5.10/ext4-misc.patch index 6816f87..5e14205 100644 --- a/ldiskfs/kernel_patches/patches/linux-5.10/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/linux-5.10/ext4-misc.patch @@ -10,15 +10,6 @@ diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 2c8b1ae..1d80381 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h -@@ -1849,6 +1849,8 @@ static inline bool ext4_verity_in_progress(struct inode *inode) - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -2089,7 +2091,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/linux-5.16/ext4-misc.patch b/ldiskfs/kernel_patches/patches/linux-5.16/ext4-misc.patch index 8786f01..55dddf8 100644 --- a/ldiskfs/kernel_patches/patches/linux-5.16/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/linux-5.16/ext4-misc.patch @@ -2,15 +2,6 @@ diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index d7332df..d04d87c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h -@@ -1956,6 +1956,8 @@ static inline bool ext4_verity_in_progress(struct inode *inode) - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -2202,7 +2204,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/linux-5.8/ext4-misc.patch b/ldiskfs/kernel_patches/patches/linux-5.8/ext4-misc.patch index 511e4c3..eae17e6 100644 --- a/ldiskfs/kernel_patches/patches/linux-5.8/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/linux-5.8/ext4-misc.patch @@ -10,15 +10,6 @@ diff -ur a/fs/ext4/ext4.h b/fs/ext4/ext4.h --- a/fs/ext4/ext4.h 2021-06-28 08:45:39.093954644 -0600 +++ b/fs/ext4/ext4.h 2021-06-28 08:46:06.913523572 -0600 -@@ -1764,6 +1764,8 @@ - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -1995,7 +1997,21 @@ EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/oe2203/ext4-misc.patch b/ldiskfs/kernel_patches/patches/oe2203/ext4-misc.patch index 126bffc..0d2cfc6 100644 --- a/ldiskfs/kernel_patches/patches/oe2203/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/oe2203/ext4-misc.patch @@ -2,15 +2,6 @@ diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 57169367362a..f3e369fc4dae 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h -@@ -1870,6 +1870,8 @@ static inline bool ext4_verity_in_progress(struct inode *inode) - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -2110,7 +2112,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/rhel8.7/ext4-misc.patch b/ldiskfs/kernel_patches/patches/rhel8.7/ext4-misc.patch index df6d180..dc8f02b 100644 --- a/ldiskfs/kernel_patches/patches/rhel8.7/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/rhel8.7/ext4-misc.patch @@ -2,15 +2,6 @@ Index: kernel-4.18.0-423.el8/fs/ext4/ext4.h =================================================================== --- kernel-4.18.0-423.el8.orig/fs/ext4/ext4.h +++ kernel-4.18.0-423.el8/fs/ext4/ext4.h -@@ -1680,6 +1680,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 - */ @@ -1903,7 +1905,21 @@ static inline bool ext4_has_unknown_ext# EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch b/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch index 7b1fcc5..aef0aa7 100644 --- a/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/sles15sp1/ext4-misc.patch @@ -8,15 +8,6 @@ --- 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) diff --git a/ldiskfs/kernel_patches/patches/sles15sp4/ext4-misc.patch b/ldiskfs/kernel_patches/patches/sles15sp4/ext4-misc.patch index d2b0c25..e58a993 100644 --- a/ldiskfs/kernel_patches/patches/sles15sp4/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/sles15sp4/ext4-misc.patch @@ -13,15 +13,6 @@ diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 8d2c493..c96d89f 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h -@@ -1913,6 +1913,8 @@ static inline bool ext4_verity_in_progress(struct inode *inode) - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -2152,7 +2154,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/suse15/ext4-misc.patch b/ldiskfs/kernel_patches/patches/suse15/ext4-misc.patch index b2ae379..d9c104c 100644 --- a/ldiskfs/kernel_patches/patches/suse15/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/suse15/ext4-misc.patch @@ -8,15 +8,6 @@ --- 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) diff --git a/ldiskfs/kernel_patches/patches/ubuntu20.04.3/ext4-misc.patch b/ldiskfs/kernel_patches/patches/ubuntu20.04.3/ext4-misc.patch index 6dd16c4..fe8d7e6 100644 --- a/ldiskfs/kernel_patches/patches/ubuntu20.04.3/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/ubuntu20.04.3/ext4-misc.patch @@ -1,15 +1,6 @@ diff -ur a/fs/ext4/ext4.h b/fs/ext4/ext4.h --- a/fs/ext4/ext4.h 2022-03-24 16:23:11.725060881 -0600 +++ b/fs/ext4/ext4.h 2022-03-24 16:24:35.400642866 -0600 -@@ -1882,6 +1882,8 @@ - - #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime - -+#define JOURNAL_START_HAS_3ARGS 1 -+ - /* - * Codes for operating systems - */ @@ -2121,7 +2123,21 @@ EXTN_FEATURE_FUNCS(2) diff --git a/ldiskfs/kernel_patches/patches/ubuntu2004/ext4-misc.patch b/ldiskfs/kernel_patches/patches/ubuntu2004/ext4-misc.patch index 94ccf1e..9343e52 100644 --- a/ldiskfs/kernel_patches/patches/ubuntu2004/ext4-misc.patch +++ b/ldiskfs/kernel_patches/patches/ubuntu2004/ext4-misc.patch @@ -2,15 +2,6 @@ Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/ext4.h =================================================================== --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/ext4.h +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/ext4.h -@@ -1591,6 +1591,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 - */ @@ -1805,7 +1807,21 @@ static inline bool ext4_has_unknown_ext# EXTN_FEATURE_FUNCS(2) diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index f12df03..6823a76 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -990,7 +990,6 @@ static inline void i_projid_write(struct inode *inode, __u32 projid) (jrnl->j_max_transaction_buffers) #endif -#ifdef LDISKFS_HT_MISC # define osd_journal_start_sb(sb, type, nblock) \ ldiskfs_journal_start_sb(sb, type, nblock) #ifdef HAVE_LDISKFS_JOURNAL_ENSURE_CREDITS @@ -1027,39 +1026,6 @@ static inline struct buffer_head *osd_ldiskfs_append(handle_t *handle, ldiskfs_journal_start(inode, type, nblocks) # define osd_transaction_size(dev) \ (jbd2_journal_get_max_txn_bufs(osd_journal(dev)) / 2) -#else /* ! defined LDISKFS_HT_MISC */ -# define LDISKFS_HT_MISC 0 -# define osd_journal_start_sb(sb, type, nblock) \ - ldiskfs_journal_start_sb(sb, nblock) - -static inline struct buffer_head *osd_ldiskfs_append(handle_t *handle, - struct inode *inode, - ldiskfs_lblk_t *nblock) -{ - struct buffer_head *bh; - int err = 0; - - bh = ldiskfs_append(handle, inode, nblock, &err); - if (bh == NULL) - bh = ERR_PTR(err); - - return bh; -} - -# ifdef HAVE___LDISKFS_FIND_ENTRY -# define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \ - (__ldiskfs_find_entry(dir, name, de, lock) ?: \ - ERR_PTR(-ENOENT)) -# else -# define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \ - (ldiskfs_find_entry_locked(dir, name, de, lock) ?: \ - ERR_PTR(-ENOENT)) -# endif -# define osd_journal_start(inode, type, nblocks) \ - ldiskfs_journal_start(inode, nblocks) -# define osd_transaction_size(dev) \ - jbd2_journal_get_max_txn_bufs(osd_journal(dev)) -#endif /* LDISKFS_HT_MISC */ #ifndef HAVE___LDISKFS_FIND_ENTRY # define __ldiskfs_add_entry(handle, child, inode, hlock) \ -- 1.8.3.1