From: Andreas Dilger Date: Sat, 26 Nov 2022 06:46:32 +0000 (-0700) Subject: LU-16367 misc: remove deprecated code X-Git-Tag: 2.15.54~52 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=96edf50039c5d629ed0cb428a9ea724d0ff652c0;hp=5efc4c1cb4f2d0680992188d587f583e7a567a09;p=fs%2Flustre-release.git LU-16367 misc: remove deprecated code Remove code that is or will become deprecated in this release based on the LUSTRE_VERSION_CODE checks. Fixes: 53fa817657 ("LU-12514 llite: move client mounting from obdclass to llite") Fixes: 3919a282ca ("LU-15106 ofd: quiet deprecated param warning") Fixes: 115bba9ffb ("LU-11110 ofd: remove obdfilter.*.* symlinks in few releases") Fixes: 73f15ad0f1 ("LU-9378 utils: split getstripe and find from lfs.1") Fixes: 88d8f0f86b ("LU-11891 utils: getstripe use --mdt-index consistently") Fixes: 78be823f33 ("LU-15218 quota: delete unused quota ID") Fixes: 0c5fbd80f1 ("LU-5969 lustreapi: replace llapi_get_version()") Signed-off-by: Andreas Dilger Change-Id: Id59371084a102d6d8257c45b55d68077f2ce7057 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49338 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: jsimmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 549b887..14ea40c 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -1623,7 +1623,7 @@ again: from_kuid(&init_user_ns, current_fsuid()), from_kgid(&init_user_ns, current_fsgid()), current_cap(), rdev, &request); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 58, 0) +#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 17, 58, 0) /* * server < 2.12.58 doesn't pack default LMV in intent_getattr reply, * fetch default LMV here. diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index e0d9615..71b45b9 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -149,7 +149,6 @@ static int lustre_fill_super(struct super_block *sb, void *lmd2_data, if (!lmd_is_client(lmd)) { #ifdef HAVE_SERVER_SUPPORT -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 15, 51, 0) static bool printed; if (!printed) { @@ -157,7 +156,6 @@ static int lustre_fill_super(struct super_block *sb, void *lmd2_data, lmd->lmd_profile); printed = true; } -#endif rc = server_fill_super(sb); #else rc = -ENODEV; diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c index 7f65e98..0098d1a 100644 --- a/lustre/ofd/lproc_ofd.c +++ b/lustre/ofd/lproc_ofd.c @@ -893,121 +893,6 @@ static ssize_t checksum_t10pi_enforce_store(struct kobject *kobj, } LUSTRE_RW_ATTR(checksum_t10pi_enforce); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 53, 0) -static ssize_t read_cache_enable_show(struct kobject *kobj, - struct attribute *attr, - char *buf) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - - if (!ofd->ofd_read_cache_enable) - return -EOPNOTSUPP; - - return lustre_attr_show(&ofd->ofd_osd->dd_kobj, - ofd->ofd_read_cache_enable, buf); -} - -static ssize_t read_cache_enable_store(struct kobject *kobj, - struct attribute *attr, - const char *buffer, size_t count) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - static bool rd_cache_warned; - - if (!rd_cache_warned) { - rd_cache_warned = true; - pr_info("ofd: 'obdfilter.*.read_cache_enable' is deprecated, use 'osd-*.*.read_cache_enable' instead\n"); - } - - if (!ofd->ofd_read_cache_enable) - return -EOPNOTSUPP; - - return lustre_attr_store(&ofd->ofd_osd->dd_kobj, - ofd->ofd_read_cache_enable, buffer, count); -} -LUSTRE_RW_ATTR(read_cache_enable); - -static ssize_t readcache_max_filesize_show(struct kobject *kobj, - struct attribute *attr, - char *buf) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - - if (!ofd->ofd_read_cache_max_filesize) - return -EOPNOTSUPP; - - return lustre_attr_show(&ofd->ofd_osd->dd_kobj, - ofd->ofd_read_cache_max_filesize, buf); -} - -static ssize_t readcache_max_filesize_store(struct kobject *kobj, - struct attribute *attr, - const char *buffer, size_t count) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - static bool max_file_warned; - - if (!max_file_warned) { - max_file_warned = true; - pr_info("ofd: 'obdfilter.*.readcache_max_filesize' is deprecated, use 'osd-*.*.readcache_max_filesize' instead\n"); - } - - if (!ofd->ofd_read_cache_max_filesize) - return -EOPNOTSUPP; - - return lustre_attr_store(&ofd->ofd_osd->dd_kobj, - ofd->ofd_read_cache_max_filesize, - buffer, count); -} -LUSTRE_RW_ATTR(readcache_max_filesize); - -static ssize_t writethrough_cache_enable_show(struct kobject *kobj, - struct attribute *attr, - char *buf) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - - if (!ofd->ofd_write_cache_enable) - return -EOPNOTSUPP; - - return lustre_attr_show(&ofd->ofd_osd->dd_kobj, - ofd->ofd_write_cache_enable, buf); -} - -static ssize_t writethrough_cache_enable_store(struct kobject *kobj, - struct attribute *attr, - const char *buffer, size_t count) -{ - struct obd_device *obd = container_of(kobj, struct obd_device, - obd_kset.kobj); - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - static bool wr_cache_warned; - - if (!wr_cache_warned) { - wr_cache_warned = true; - pr_info("ofd: 'obdfilter.*.writethrough_cache_enable' is deprecated, use 'osd-*.*.writethrough_cache_enable' instead\n"); - } - - if (!ofd->ofd_write_cache_enable) - return -EOPNOTSUPP; - - return lustre_attr_store(&ofd->ofd_osd->dd_kobj, - ofd->ofd_write_cache_enable, - buffer, count); -} -LUSTRE_RW_ATTR(writethrough_cache_enable); -#endif - LPROC_SEQ_FOPS_RO_TYPE(ofd, recovery_status); LUSTRE_RW_ATTR(recovery_time_hard); LUSTRE_RW_ATTR(recovery_time_soft); @@ -1122,11 +1007,6 @@ static struct attribute *ofd_attrs[] = { &lustre_attr_access_log_size.attr, &lustre_attr_job_cleanup_interval.attr, &lustre_attr_checksum_t10pi_enforce.attr, -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 53, 0) - &lustre_attr_read_cache_enable.attr, - &lustre_attr_readcache_max_filesize.attr, - &lustre_attr_writethrough_cache_enable.attr, -#endif NULL, }; diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 5848454..cb1ac93 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -710,55 +710,6 @@ static const struct lu_device_operations ofd_lu_ops = { .ldo_prepare = ofd_prepare, }; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 14, 53, 0) -/** - * Expose OSD statistics to OFD layer. - * - * The osd interfaces to the backend file system exposes useful data - * such as brw_stats and read or write cache states. This same data - * needs to be exposed into the obdfilter (ofd) layer to maintain - * backwards compatibility. This function creates the symlinks in the - * proc layer to enable this. - * - * \param[in] ofd OFD device - */ -static void ofd_procfs_add_brw_stats_symlink(struct ofd_device *ofd) -{ - struct obd_device *obd = ofd_obd(ofd); - struct obd_device *osd_obd = ofd->ofd_osd_exp->exp_obd; - const struct kobj_type *osd_type; - int i; - - osd_type = get_ktype(&ofd->ofd_osd->dd_kobj); - for (i = 0; osd_type->default_attrs[i]; i++) { - if (strcmp(osd_type->default_attrs[i]->name, - "read_cache_enable") == 0) { - ofd->ofd_read_cache_enable = - osd_type->default_attrs[i]; - } - - if (strcmp(osd_type->default_attrs[i]->name, - "readcache_max_filesize") == 0) { - ofd->ofd_read_cache_max_filesize = - osd_type->default_attrs[i]; - } - - if (strcmp(osd_type->default_attrs[i]->name, - "writethrough_cache_enable") == 0) { - ofd->ofd_write_cache_enable = - osd_type->default_attrs[i]; - } - } - - if (obd->obd_proc_entry == NULL) - return; - - lprocfs_add_symlink("brw_stats", obd->obd_proc_entry, - "../../%s/%s/brw_stats", - osd_obd->obd_type->typ_name, obd->obd_name); -} -#endif - /** * Cleanup all procfs entries in OFD. * @@ -3061,10 +3012,6 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m, RETURN(rc); } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 14, 53, 0) - ofd_procfs_add_brw_stats_symlink(m); -#endif - snprintf(info->fti_u.name, sizeof(info->fti_u.name), "%s-%s", "filter"/*LUSTRE_OST_NAME*/, obd->obd_uuid.uuid); m->ofd_namespace = ldlm_namespace_new(obd, info->fti_u.name, diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 4eb670b..ee2f20b 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -5545,11 +5545,6 @@ err_free: param.fp_exclude_pool = !!neg_opt; param.fp_check_pool = 1; break; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 14, 53, 0) - case 'p': /* want this for --pool, to match getstripe/find */ - fprintf(stderr, - "warning: -p deprecated, use --print0 or -0\n"); -#endif case '0': param.fp_zero_end = 1; break; @@ -6799,11 +6794,6 @@ static int lfs_setdirstripe(int argc, char **argv) if (lsa.lsa_stripe_off == LLAPI_LAYOUT_DEFAULT) lsa.lsa_stripe_off = mdts[0]; break; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 53, 0) - case 'm': - fprintf(stderr, - "warning: '-m' is deprecated, use '--mode' or '-o' instead\n"); -#endif case 'o': mode_opt = optarg; break; @@ -7808,10 +7798,10 @@ quota_type_def: break; #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0) case 'd': -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 15, 53, 0) - fprintf(stderr, "'-d' deprecatd, use '-D' or '--default'\n"); -#endif - /* falltrrough */ + fprintf(stderr, + "%s setquota: '-d' deprecated, use '-D' or '--default'\n", + progname); + fallthrough; #endif case 'D': use_default = true; diff --git a/lustre/utils/liblustreapi_util.c b/lustre/utils/liblustreapi_util.c index e751bcbf..dc24fce 100644 --- a/lustre/utils/liblustreapi_util.c +++ b/lustre/utils/liblustreapi_util.c @@ -161,16 +161,15 @@ int llapi_get_version_string(char *version, unsigned int version_size) */ int llapi_get_version(char *buffer, int buffer_size, char **version) { - int rc; -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 8, 53, 0) static bool printed; + int rc; + if (!printed) { fprintf(stderr, "%s deprecated, use llapi_get_version_string()\n", __func__); printed = true; } -#endif rc = llapi_get_version_string(buffer, buffer_size); /* keep old return style for this legacy function */