From 5315db3f1066619d6effe4f778d2df3ad1ba738f Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 31 Mar 2020 19:14:00 -0600 Subject: [PATCH] LU-6179 llite: remove LOCKAHEAD_OLD compatibility The OBD_CONNECT_LOCKAHEAD_OLD feature was added for a short time for compatibility with an implementation of LDLM lockahead that was later replaced by OBD_CONNECT_LOCKAHEAD2. Remove the compatibility code for this old implementation that has been disabled since the 2.13 release. Also remove other obsolete compatibility code dating back to 2.8.53. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I4444eff180b2c6e2b27d260413f2debbb2ce7057 Reviewed-on: https://review.whamcloud.com/38109 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: James Simmons --- lustre/include/lustre_dlm_flags.h | 10 ---------- lustre/include/lustre_export.h | 5 ----- lustre/include/uapi/linux/lustre/lustre_idl.h | 2 +- lustre/llite/dir.c | 4 ---- lustre/llite/llite_lib.c | 17 ----------------- lustre/ofd/ofd_dev.c | 12 +----------- lustre/osc/osc_lock.c | 2 +- lustre/ptlrpc/wiretest.c | 2 -- lustre/utils/mount_lustre.c | 14 -------------- lustre/utils/wirecheck.c | 1 - lustre/utils/wiretest.c | 2 -- 11 files changed, 3 insertions(+), 68 deletions(-) diff --git a/lustre/include/lustre_dlm_flags.h b/lustre/include/lustre_dlm_flags.h index 9fdebce..1fa049d 100644 --- a/lustre/include/lustre_dlm_flags.h +++ b/lustre/include/lustre_dlm_flags.h @@ -158,16 +158,6 @@ #define ldlm_clear_converting(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 25) /** - * Part of original lockahead implementation, OBD_CONNECT_LOCKAHEAD_OLD. - * Reserved temporarily to allow those implementations to keep working. - * Will be removed after 2.12 release. - * */ -#define LDLM_FL_LOCKAHEAD_OLD_RESERVED 0x0000000010000000ULL /* bit 28 */ -#define ldlm_is_do_not_expand_io(_l) LDLM_TEST_FLAG((_l), 1ULL << 28) -#define ldlm_set_do_not_expand_io(_l) LDLM_SET_FLAG((_l), 1ULL << 28) -#define ldlm_clear_do_not_expand_io(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 28) - -/** * Do not expand this lock. Grant it only on the extent requested. * Used for manually requested locks from the client (LU_LADVISE_LOCKAHEAD). * */ diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index 8f45dd4..f6e136a 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -442,11 +442,6 @@ static inline int exp_connect_large_acl(struct obd_export *exp) return !!(exp_connect_flags(exp) & OBD_CONNECT_LARGE_ACL); } -static inline int exp_connect_lockahead_old(struct obd_export *exp) -{ - return !!(exp_connect_flags(exp) & OBD_CONNECT_LOCKAHEAD_OLD); -} - static inline int exp_connect_lockahead(struct obd_export *exp) { return !!(exp_connect_flags2(exp) & OBD_CONNECT2_LOCKAHEAD); diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 2f4c083..1402fbb 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -816,7 +816,7 @@ struct ptlrpc_body_v2 { RPCs in parallel */ #define OBD_CONNECT_DIR_STRIPE 0x400000000000000ULL /* striped DNE dir */ #define OBD_CONNECT_SUBTREE 0x800000000000000ULL /* fileset mount */ -#define OBD_CONNECT_LOCKAHEAD_OLD 0x1000000000000000ULL /* Old Cray lockahead */ +/* was OBD_CONNECT_LOCKAHEAD_OLD 0x1000000000000000ULL old lockahead 2.12-2.13*/ /** bulk matchbits is sent within ptlrpc_body */ #define OBD_CONNECT_BULK_MBITS 0x2000000000000000ULL diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index c70f91d..4f54260 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -1437,11 +1437,7 @@ out_free: GOTO(lmv_out_free, rc = -EINVAL); } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 50, 0) - mode = data->ioc_type != 0 ? data->ioc_type : S_IRWXUGO; -#else mode = data->ioc_type; -#endif rc = ll_dir_setdirstripe(dentry, lum, lumlen, filename, mode); lmv_out_free: OBD_FREE_LARGE(buf, len); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 010583b..9c4983b 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -460,23 +460,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK | OBD_CONNECT_BULK_MBITS | OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2 | OBD_CONNECT_GRANT_SHRINK; - -/* The client currently advertises support for OBD_CONNECT_LOCKAHEAD_OLD so it - * can interoperate with an older version of lockahead which was released prior - * to landing in master. This support will be dropped when 2.13 development - * starts. At the point, we should not just drop the connect flag (below), we - * should also remove the support in the code. - * - * Removing it means a few things: - * 1. Remove this section here - * 2. Remove CEF_NONBLOCK in ll_file_lockahead() - * 3. Remove function exp_connect_lockahead_old - * 4. Remove LDLM_FL_LOCKAHEAD_OLD_RESERVED in lustre_dlm_flags.h - * */ -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 50, 0) - data->ocd_connect_flags |= OBD_CONNECT_LOCKAHEAD_OLD; -#endif - data->ocd_connect_flags2 = OBD_CONNECT2_LOCKAHEAD | OBD_CONNECT2_INC_XID; diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index cfcb420..bb60e94 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1740,18 +1740,8 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) out: mutex_unlock(&oseq->os_create_lock); out_nolock: - if (rc == 0) { -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0) - struct ofd_thread_info *info = ofd_info(tsi->tsi_env); - struct lu_fid *fid = &info->fti_fid; - - /* For compatible purpose, it needs to convert back to - * OST ID before put it on wire. */ - *fid = rep_oa->o_oi.oi_fid; - fid_to_ostid(fid, &rep_oa->o_oi); -#endif + if (rc == 0) rep_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP; - } ofd_seq_put(tsi->tsi_env, oseq); out_sem: diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index d50fddb..3370386 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -977,7 +977,7 @@ static int osc_lock_enqueue(const struct lu_env *env, RETURN(0); if ((oscl->ols_flags & LDLM_FL_NO_EXPANSION) && - !(exp_connect_lockahead_old(exp) || exp_connect_lockahead(exp))) { + !exp_connect_lockahead(exp)) { result = -EOPNOTSUPP; CERROR("%s: server does not support lockahead/locknoexpand: rc = %d\n", exp->exp_obd->obd_name, result); diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 8375e5a..b0d40ad 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1332,8 +1332,6 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_DIR_STRIPE); LASSERTF(OBD_CONNECT_SUBTREE == 0x800000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_SUBTREE); - LASSERTF(OBD_CONNECT_LOCKAHEAD_OLD == 0x1000000000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_LOCKAHEAD_OLD); LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_BULK_MBITS); LASSERTF(OBD_CONNECT_OBDOPACK == 0x4000000000000000ULL, "found 0x%.16llxULL\n", diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 081f0f2..7ed149c 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -58,20 +58,6 @@ #include "obdctl.h" #include "mount_utils.h" -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0) -/* - * LU-1783 - * We only #include a kernel level include file here because - * important MS_ flag #defines are missing from the SLES version - * of sys/mount.h - * In the future if SLES updates sys/mount.h to have a more complete - * set of flag #defines we should stop including linux/fs.h - */ -#if !defined(MS_RDONLY) -#include -#endif -#endif - #ifdef HAVE_LIBMOUNT # define WITH_LIBMOUNT "(libmount)" #else diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index e87dff7..cfebf2c 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -603,7 +603,6 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT_MULTIMODRPCS); CHECK_DEFINE_64X(OBD_CONNECT_DIR_STRIPE); CHECK_DEFINE_64X(OBD_CONNECT_SUBTREE); - CHECK_DEFINE_64X(OBD_CONNECT_LOCKAHEAD_OLD); CHECK_DEFINE_64X(OBD_CONNECT_BULK_MBITS); CHECK_DEFINE_64X(OBD_CONNECT_OBDOPACK); CHECK_DEFINE_64X(OBD_CONNECT_FLAGS2); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index c150111..b38f1fe 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1364,8 +1364,6 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_DIR_STRIPE); LASSERTF(OBD_CONNECT_SUBTREE == 0x800000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_SUBTREE); - LASSERTF(OBD_CONNECT_LOCKAHEAD_OLD == 0x1000000000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_LOCKAHEAD_OLD); LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_BULK_MBITS); LASSERTF(OBD_CONNECT_OBDOPACK == 0x4000000000000000ULL, "found 0x%.16llxULL\n", -- 1.8.3.1