* by osd only doesn't have mdt/mdd slices -bzzz */
lustre_cfg_bufs_reset(bufs, mdt_obd_name(m));
lustre_cfg_bufs_set_string(bufs, 1, NULL);
- lcfg = lustre_cfg_new(LCFG_PRE_CLEANUP, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
RETURN_EXIT;
+ lustre_cfg_init(lcfg, LCFG_PRE_CLEANUP, bufs);
top->ld_ops->ldo_process_config(env, top, lcfg);
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
EXIT;
}
if (obd->obd_fail)
strcat(flags, "A");
lustre_cfg_bufs_set_string(bufs, 1, flags);
- lcfg = lustre_cfg_new(LCFG_CLEANUP, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
RETURN_EXIT;
+ lustre_cfg_init(lcfg, LCFG_CLEANUP, bufs);
LASSERT(top);
top->ld_ops->ldo_process_config(env, top, lcfg);
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
lu_site_purge(env, top->ld_site, -1);
lustre_cfg_bufs_set_string(bufs, 2, uuid);
lustre_cfg_bufs_set_string(bufs, 3, lprof->lp_dt);
- lcfg = lustre_cfg_new(LCFG_ATTACH, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
GOTO(put_profile, rc = -ENOMEM);
+ lustre_cfg_init(lcfg, LCFG_ATTACH, bufs);
rc = class_attach(lcfg);
if (rc)
GOTO(lcfg_cleanup, rc = -EINVAL);
}
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
lustre_cfg_bufs_reset(bufs, name);
lustre_cfg_bufs_set_string(bufs, 1, uuid);
lustre_cfg_bufs_set_string(bufs, 2, dev);
lustre_cfg_bufs_set_string(bufs, 3, lprof->lp_dt);
- lcfg = lustre_cfg_new(LCFG_SETUP, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
GOTO(class_detach, rc = -ENOMEM);
+ lustre_cfg_init(lcfg, LCFG_SETUP, bufs);
rc = class_setup(obd, lcfg);
if (rc)
if (rc)
class_detach(obd, lcfg);
lcfg_cleanup:
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
put_profile:
class_put_profile(lprof);
free_bufs:
lustre_cfg_bufs_set_string(bufs, 2, uuid);
lustre_cfg_bufs_set_string(bufs, 3, lprof->lp_dt);
- lcfg = lustre_cfg_new(LCFG_ATTACH, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
GOTO(put_profile, rc = -ENOMEM);
+ lustre_cfg_init(lcfg, LCFG_ATTACH, bufs);
rc = class_attach(lcfg);
if (rc)
GOTO(lcfg_cleanup, rc = -EINVAL);
}
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
lustre_cfg_bufs_reset(bufs, qmtname);
lustre_cfg_bufs_set_string(bufs, 1, uuid);
lustre_cfg_bufs_set_string(bufs, 3,
mdt->mdt_bottom->dd_lu_dev.ld_obd->obd_name);
- lcfg = lustre_cfg_new(LCFG_SETUP, bufs);
- if (lcfg == NULL)
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen));
+ if (!lcfg)
GOTO(class_detach, rc = -ENOMEM);
+ lustre_cfg_init(lcfg, LCFG_SETUP, bufs);
rc = class_setup(obd, lcfg);
if (rc)
if (rc)
class_detach(obd, lcfg);
lcfg_cleanup:
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
put_profile:
class_put_profile(lprof);
cleanup_mem:
cfg);
}
- if (old_cfg != NULL)
- lustre_cfg_free(cfg);
-
+ if (old_cfg)
+ OBD_FREE(cfg, lustre_cfg_len(cfg->lcfg_bufcount,
+ cfg->lcfg_buflens));
break;
}
default: