return (rc);
}
-/* For interoperability between 1.8 and 2.0. */
+/* For interoperability, the left element is old parameter, the right one
+ * is the new version of the parameter, if some parameter is deprecated,
+ * the new version should be set as NULL. */
static struct cfg_interop_param mdt_interop_param[] = {
{ "mdt.group_upcall", NULL },
- { "mdt.quota_type", "mdd.quota_type" },
+ { "mdt.quota_type", NULL },
+ { "mdd.quota_type", NULL },
{ "mdt.rootsquash", "mdt.root_squash" },
{ "mdt.nosquash_nid", "mdt.nosquash_nids" },
{ NULL }
struct mdt_device *m = mdt_dev(d);
struct md_device *md_next = m->mdt_child;
struct lu_device *next = md2lu_dev(md_next);
- int rc = 0;
+ int rc;
ENTRY;
switch (cfg->lcfg_command) {
struct lprocfs_static_vars lvars;
struct obd_device *obd = d->ld_obd;
- /* For interoperability between 1.8 and 2.0. */
+ /* For interoperability */
struct cfg_interop_param *ptr = NULL;
struct lustre_cfg *old_cfg = NULL;
char *param = NULL;
ptr = class_find_old_param(param, mdt_interop_param);
if (ptr != NULL) {
if (ptr->new_param == NULL) {
- CWARN("For 1.8 interoperability, skip this %s."
+ rc = 0;
+ CWARN("For interoperability, skip this %s."
" It is obsolete.\n", ptr->old_param);
- break;
+ break;
}
CWARN("Found old param %s, changed it to %s.\n",
EXIT;
}
+/* For interoperability, see mdt_interop_param[]. */
+static struct cfg_interop_param ofd_interop_param[] = {
+ { "ost.quota_type", NULL },
+ { NULL }
+};
+
/* used by MGS to process specific configurations */
static int ofd_process_config(const struct lu_env *env, struct lu_device *d,
struct lustre_cfg *cfg)
case LCFG_PARAM: {
struct lprocfs_static_vars lvars;
+ /* For interoperability */
+ struct cfg_interop_param *ptr = NULL;
+ struct lustre_cfg *old_cfg = NULL;
+ char *param = NULL;
+
+ param = lustre_cfg_string(cfg, 1);
+ if (param == NULL) {
+ CERROR("param is empty\n");
+ rc = -EINVAL;
+ break;
+ }
+
+ ptr = class_find_old_param(param, ofd_interop_param);
+ if (ptr != NULL) {
+ if (ptr->new_param == NULL) {
+ rc = 0;
+ CWARN("For interoperability, skip this %s."
+ " It is obsolete.\n", ptr->old_param);
+ break;
+ }
+
+ CWARN("Found old param %s, changed it to %s.\n",
+ ptr->old_param, ptr->new_param);
+
+ old_cfg = cfg;
+ cfg = lustre_cfg_rename(old_cfg, ptr->new_param);
+ if (IS_ERR(cfg)) {
+ rc = PTR_ERR(cfg);
+ break;
+ }
+ }
+
lprocfs_ofd_init_vars(&lvars);
rc = class_process_proc_param(PARAM_OST, lvars.obd_vars, cfg,
d->ld_obd);