struct obd_device *class_name2obd(char *name);
int class_uuid2dev(struct obd_uuid *uuid);
struct obd_device *class_uuid2obd(struct obd_uuid *uuid);
+void class_obd_list(void);
struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid,
char * typ_name,
struct obd_uuid *grp_uuid);
int rc;
ENTRY;
+ class_obd_list();
+
tgt_obd = class_find_client_obd(tgt_uuid, LUSTRE_OSC_NAME,
&obd->obd_uuid);
/* There better be a lov */
if (!osc)
RETURN(0);
+ if (IS_ERR(osc))
+ RETURN(PTR_ERR(osc));
obd_register_observer(osc, NULL);
char *logname, char *lovname, char *ostuuid)
{
struct llog_handle *llh = NULL;
- char *nodeuuid, *oscname, *oscuuid;
+ char *nodeuuid, *oscname, *oscuuid, *lovuuid;
char index[5];
int rc;
name_create(libcfs_nid2str(mti->mti_nid), "_UUID", &nodeuuid);
name_create(mti->mti_svname, "-osc", &oscname);
name_create(oscname, "_UUID", &oscuuid);
+ name_create(lovname, "_UUID", &lovuuid);
/*
#03 L add_uuid nid=uml1@tcp(0x20000c0a80201) 0: 1:uml1_UUID
*/
rc = record_start_log(obd, &llh, logname);
rc = record_add_uuid(obd, llh, mti->mti_nid, nodeuuid);
- rc = record_attach(obd, llh, oscname, LUSTRE_OSC_NAME, oscuuid);
+ rc = record_attach(obd, llh, oscname, LUSTRE_OSC_NAME, lovuuid);
rc = record_setup(obd, llh, oscname, ostuuid, nodeuuid, 0, 0);
/* FIXME add uuid, add_conn for failover ost's */
snprintf(index, sizeof(index), "%d", mti->mti_stripe_index);
rc = record_lov_add(obd,llh, lovname, ostuuid, index,"1"/*generation*/);
rc = record_end_log(obd, &llh);
+ name_destroy(lovuuid);
name_destroy(oscuuid);
name_destroy(oscname);
name_destroy(nodeuuid);
EXPORT_SYMBOL(class_name2obd);
EXPORT_SYMBOL(class_uuid2dev);
EXPORT_SYMBOL(class_uuid2obd);
+EXPORT_SYMBOL(class_obd_list);
EXPORT_SYMBOL(class_find_client_obd);
EXPORT_SYMBOL(class_find_client_notype);
EXPORT_SYMBOL(class_devices_in_group);
return &obd_dev[dev];
}
+void class_obd_list(void)
+{
+ char *status;
+ int i;
+
+ spin_lock(&obd_dev_lock);
+ for (i = 0; i < MAX_OBD_DEVICES; i++) {
+ struct obd_device *obd = &obd_dev[i];
+ if (obd->obd_type == NULL)
+ continue;
+ if (obd->obd_stopping)
+ status = "ST";
+ else if (obd->obd_set_up)
+ status = "UP";
+ else if (obd->obd_attached)
+ status = "AT";
+ else
+ status = "--";
+ CDEBUG(D_WARNING, "%3d %s %s %s %s %d\n",
+ i, status, obd->obd_type->typ_name,
+ obd->obd_name, obd->obd_uuid.uuid,
+ atomic_read(&obd->obd_refcount));
+ }
+ spin_unlock(&obd_dev_lock);
+ return;
+}
+
/* Search for a client OBD connected to tgt_uuid. If grp_uuid is
specified, then only the client with that uuid is returned,
otherwise any client connected to the tgt is returned. */
lcfg->lcfg_command, inst_name);
}
- if (cfg && lcfg->lcfg_command == LCFG_ATTACH) {
+ /* we override the llog's uuid for clients, to insure they
+ are unique */
+ if (cfg && cfg->cfg_instance &&
+ lcfg->lcfg_command == LCFG_ATTACH) {
lustre_cfg_bufs_set_string(&bufs, 2, cfg->cfg_uuid.uuid);
}
}
}
+ CDEBUG(D_MOUNT, "after lustre_get_process_log %s\n", logname);
+ class_obd_list();
+
out:
return (rc);
}
/* The MGC starts targets using the svname llog */
cfg.cfg_instance = NULL;
- cfg.cfg_uuid = lsi->lsi_mgc->obd_uuid;
rc = lustre_get_process_log(sb, lsi->lsi_ldd->ldd_svname, &cfg);
if (rc) {
CERROR("failed to start server %s: %d\n",