static int mgc_setup(struct obd_device *obd, obd_count len, void *buf)
{
struct lustre_mount_info *lmi;
+ struct lustre_sb_info *sbi;
struct mgc_obd *mgc = &obd->u.mgc;
//struct lprocfs_static_vars lvars;
int rc;
RETURN(-ENOENT);
}
+ sbi = s2sbi(lmi->lmi_sb);
+ sbi->lsi_mgc = obd;
+
rc = mgc_fs_setup(lmi->lmi_sb, lmi->lmi_mnt);
if (rc) {
CERROR("fs setup failed %d\n", rc);
struct obd_device *obd = exp->exp_obd;
struct obd_ioctl_data *data = karg;
struct llog_ctxt *ctxt;
+ struct lvfs_run_ctxt saved;
int rc;
ENTRY;
}
sprintf(conf_prof, "%s-conf", name);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+
ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
rc = class_config_parse_llog(ctxt, conf_prof, NULL);
if (rc < 0)
CERROR("Unable to process log: %s\n", conf_prof);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
OBD_FREE(conf_prof, len);
RETURN(rc);
OBD_ALLOC(logname, PATH_MAX);
if (logname == NULL)
return ERR_PTR(-ENOMEM);
- if (fsname)
- len = snprintf(logname, PATH_MAX, "CONFIGS/%s/%s", fsname, name);
- else
+//FIXME: Need to changing mkfs
+// if (fsname)
+// len = snprintf(logname, PATH_MAX, "CONFIGS/%s/%s", fsname, name);
+// else
len = snprintf(logname, PATH_MAX, "CONFIGS/%s", name);
if (len >= PATH_MAX - 1) {
filp = ERR_PTR(-ENAMETOOLONG);
} else {
+ printk("logname = %s\n", logname);
filp = l_filp_open(logname, flags, mode);
if (IS_ERR(filp))
CERROR("logfile creation %s: %ld\n", logname,
OBD_FREE(lmi, sizeof(*lmi));
return -ENOMEM;
}
+ memcpy(name_cp, name, strlen(name));
down(&lustre_mount_info_lock);
if (lustre_find_mount(name)) {
obd = sbi->lsi_mgc;
LASSERT(obd);
mgcobd = &obd->u.mgc;
-
+
/* Find all the logs in the local CONFIGS directory */
err = dentry_readdir(obd, mgcobd->mgc_configs_dir,
mgcobd->mgc_vfsmnt, &dentry_list);
CERROR("starting log %s\n", logname);
ioc_data.ioc_inllen1 = len + 1;
ioc_data.ioc_inlbuf1 = logname;
+
err = obd_iocontrol(OBD_IOC_START, obd->obd_self_export,
sizeof ioc_data, &ioc_data, NULL);
if (err) {
}
/* Set up a mgcobd to process startup logs */
-static int lustre_start_mgc(char *mcname, struct super_block *sb)
+static int lustre_start_mgc(char *mgcname, struct super_block *sb)
{
struct config_llog_instance cfg;
struct lustre_sb_info *sbi = s2sbi(sb);
struct obd_device *obd;
int err = 0;
- cfg.cfg_instance = mcname;
- snprintf(cfg.cfg_uuid.uuid, sizeof(cfg.cfg_uuid.uuid), mcname);
+ cfg.cfg_instance = mgcname;
+ snprintf(cfg.cfg_uuid.uuid, sizeof(cfg.cfg_uuid.uuid), mgcname);
- err = do_lcfg(mcname, 0, LCFG_ATTACH, LUSTRE_MGC_NAME, cfg.cfg_uuid.uuid, 0, 0);
+ err = do_lcfg(mgcname, 0, LCFG_ATTACH, LUSTRE_MGC_NAME, cfg.cfg_uuid.uuid, 0, 0);
if (err)
goto out_free;
- err = do_lcfg(mcname, 0, LCFG_SETUP, 0, 0, 0, 0);
+ err = do_lcfg(mgcname, 0, LCFG_SETUP, 0, 0, 0, 0);
if (err) {
CERROR("mgcobd setup error %d\n", err);
- do_lcfg(mcname, 0, LCFG_DETACH, 0, 0, 0, 0);
+ do_lcfg(mgcname, 0, LCFG_DETACH, 0, 0, 0, 0);
goto out_free;
}
-
- obd = class_name2obd(mcname);
+
+ obd = class_name2obd(mgcname);
if (!obd) {
- CERROR("Can't find mgcobd %s\n", mcname);
+ CERROR("Can't find mgcobd %s\n", mgcname);
err = -ENOTCONN;
goto out_free;
}
- sbi->lsi_mgc = obd;
out_free:
return err;