struct mdc_device *mc, struct lustre_cfg *cfg)
{
struct mdc_cli_desc *desc = &mc->mc_desc;
- struct obd_device *mdc, *mdt;
+ struct obd_device *mdc;
const char *srv = lustre_cfg_string(cfg, 0);
const char *uuid_str = lustre_cfg_string(cfg, 1);
const char *index = lustre_cfg_string(cfg, 2);
+ const char *mdc_uuid_str = lustre_cfg_string(cfg, 4);
char *p;
int rc = 0;
RETURN(-EINVAL);
}
- /* find local MDT obd to get group uuid */
- mdt = class_name2obd(srv);
- if (mdt == NULL) {
- CERROR("No such OBD %s\n", srv);
- LBUG();
- }
obd_str2uuid(&desc->cl_srv_uuid, uuid_str);
+ obd_str2uuid(&desc->cl_cli_uuid, mdc_uuid_str);
/* try to find MDC OBD connected to the needed MDT */
mdc = class_find_client_obd(&desc->cl_srv_uuid, LUSTRE_MDC_NAME,
- &mdt->obd_uuid);
+ &desc->cl_cli_uuid);
if (!mdc) {
CERROR("Cannot find MDC OBD connected to %s\n", uuid_str);
rc = -ENOENT;
CDEBUG(D_CONFIG, "connect to %s(%s)\n",
mdc->obd_name, mdc->obd_uuid.uuid);
- rc = obd_connect(ctx, conn, mdc, &mdt->obd_uuid, NULL);
+
+ rc = obd_connect(ctx, conn, mdc, &mdc->obd_uuid, NULL);
if (rc) {
CERROR("target %s connect error %d\n",
struct lustre_handle cl_conn;
/* uuid of remote MDT to connect */
struct obd_uuid cl_srv_uuid;
+ /* mdc uuid */
+ struct obd_uuid cl_cli_uuid;
/* export of mdc obd */
struct obd_export *cl_exp;
};
struct lustre_cfg *cfg)
{
struct lu_site *ls = m->mdt_md_dev.md_lu_dev.ld_site;
- struct obd_device *mdc;
- struct obd_uuid *uuidp;
- char *uuid_str;
+ struct obd_device *mdc, *mdt;
+ struct obd_uuid *uuidp, *mdcuuidp;
+ char *uuid_str, *mdc_uuid_str;
int rc;
int index;
struct mdt_thread_info *info;
ENTRY;
info = lu_context_key_get(ctx, &mdt_thread_key);
- uuidp = &info->mti_u.uuid;
+ uuidp = &info->mti_u.uuid[0];
+ mdcuuidp = &info->mti_u.uuid[1];
LASSERT(index_string);
RETURN(0);
uuid_str = lustre_cfg_string(cfg, 1);
+ mdc_uuid_str = lustre_cfg_string(cfg, 4);
obd_str2uuid(uuidp, uuid_str);
- mdc = class_find_client_obd(uuidp, LUSTRE_MDC_NAME, NULL);
+ obd_str2uuid(mdcuuidp, mdc_uuid_str);
+
+ mdc = class_find_client_obd(uuidp, LUSTRE_MDC_NAME, mdcuuidp);
if (!mdc) {
CERROR("can't find controller MDC by uuid %s\n",
uuid_str);
ldlm_policy_data_t mti_policy; /* for mdt_object_lock() */
struct ldlm_res_id mti_res_id; /* for mdt_object_lock() */
union {
- struct obd_uuid uuid; /* for mdt_seq_init_cli() */
+ struct obd_uuid uuid[2]; /* for mdt_seq_init_cli() */
char ns_name[48]; /* for mdt_init0() */
struct lustre_cfg_bufs bufs; /* for mdt_stack_fini() */
struct kstatfs ksfs; /* for mdt_statfs() */
static inline int record_mdc_add(struct obd_device *obd,
struct llog_handle *llh,
- char *logname, char *uuid,
- char *index, char *gen)
+ char *logname, char *mdcuuid,
+ char *mdtuuid, char *index,
+ char *gen)
{
return record_base(obd,llh,logname,0,LCFG_ADD_MDC,
- uuid,index,gen,0);
+ mdtuuid,index,gen,mdcuuid);
}
static inline int record_lov_add(struct obd_device *obd,
rc = record_setup(obd, llh, mdcname, mti->mti_uuid, nodeuuid, 0, 0);
rc = mgs_write_log_failnids(obd, mti, llh, mdcname);
snprintf(index, sizeof(index), "%d", mti->mti_stripe_index);
- rc = record_mdc_add(obd, llh, lmvname, mti->mti_uuid, index, "1");
+ rc = record_mdc_add(obd, llh, lmvname, mdcuuid, mti->mti_uuid,
+ index, "1");
rc = record_marker(obd, llh, fsdb, CM_END, mti->mti_svname,
"add mdc");
rc = record_end_log(obd, &llh);
libcfs_nid2str(mti->mti_nids[i]));
rc = record_add_uuid(obd, llh, mti->mti_nids[i], nodeuuid);
}
- rc = record_attach(obd, llh, mdcname, LUSTRE_MDC_NAME, mdtuuid);
+ rc = record_attach(obd, llh, mdcname, LUSTRE_MDC_NAME, mdcuuid);
rc = record_setup(obd, llh, mdcname, mti->mti_uuid, nodeuuid, 0, 0);
rc = mgs_write_log_failnids(obd, mti, llh, mdcname);
snprintf(index, sizeof(index), "%d", idx);
- rc = record_mdc_add(obd, llh, logname, mti->mti_uuid /*mdcname*/,
+ rc = record_mdc_add(obd, llh, logname, mdcuuid, mti->mti_uuid,
index, "1");
rc = record_marker(obd, llh, fsdb, CM_END, mti->mti_svname, "add mdc");
rc = record_end_log(obd, &llh);