struct lustre_md md;
class_uuid_t uuid;
struct config_llog_instance cfg;
+ char ll_instance[sizeof(sbi) * 2 + 1];
struct lustre_profile *lprof;
char *zconf_mdsnid, *zconf_mdsname, *zconf_profile;
char *osc = NULL, *mdc = NULL;
/* generate a string unique to this super, let's try
the address of the super itself.*/
- OBD_ALLOC(sbi->ll_instance, sizeof(sbi) * 2 + 1);
- if (sbi->ll_instance == NULL)
- GOTO(out_free, err = -ENOMEM);
- sprintf(sbi->ll_instance, "%p", sbi);
+ sprintf(ll_instance, "%p", sbi);
/* retrive & parse config log */
- cfg.cfg_instance = sbi->ll_instance;
+ cfg.cfg_instance = ll_instance;
cfg.cfg_uuid = sbi->ll_sb_uuid;
- err = liblustre_process_log(&cfg,
- zconf_mdsnid, zconf_mdsname, zconf_profile, 1);
+ err = liblustre_process_log(&cfg, zconf_mdsnid, zconf_mdsname,
+ zconf_profile, 1);
if (err < 0) {
CERROR("Unable to process log: %s\n", zconf_profile);
GOTO(out_free, err);
CERROR("No profile found: %s\n", zconf_profile);
GOTO(out_free, err = -EINVAL);
}
- if (osc)
- OBD_FREE(osc, strlen(osc) + 1);
- OBD_ALLOC(osc, strlen(lprof->lp_osc) +
- strlen(sbi->ll_instance) + 2);
- sprintf(osc, "%s-%s", lprof->lp_osc, sbi->ll_instance);
+ OBD_ALLOC(osc, strlen(lprof->lp_osc) + strlen(ll_instance) + 2);
+ sprintf(osc, "%s-%s", lprof->lp_osc, ll_instance);
- if (mdc)
- OBD_FREE(mdc, strlen(mdc) + 1);
- OBD_ALLOC(mdc, strlen(lprof->lp_mdc) +
- strlen(sbi->ll_instance) + 2);
- sprintf(mdc, "%s-%s", lprof->lp_mdc, sbi->ll_instance);
+ OBD_ALLOC(mdc, strlen(lprof->lp_mdc) + strlen(ll_instance) + 2);
+ sprintf(mdc, "%s-%s", lprof->lp_mdc, ll_instance);
if (!osc) {
CERROR("no osc\n");
out_mdc:
obd_disconnect(sbi->ll_mdc_exp);
out_free:
+ if (osc)
+ OBD_FREE(osc, strlen(osc) + 1);
+ if (mdc)
+ OBD_FREE(mdc, strlen(mdc) + 1);
OBD_FREE(sbi, sizeof(*sbi));
return err;
}
ptlrpc_req_finished(request);
if (root == NULL || is_bad_inode(root)) {
- /* XXX might need iput() for bad inode */
+ if (md.lsm != NULL)
+ obd_free_memmd(sbi->ll_osc_exp, &md.lsm);
CERROR("lustre_lite: bad iget4 for root\n");
GOTO(out_root, err = -EBADF);
}
subdirs++;
CERROR("dentry %p dump: name=%.*s parent=%.*s (%p), inode=%p, count=%u,"
- " flags=0x%x, vfs_flags=0x%x, fsdata=%p, %d subdirs\n", dentry,
+ " flags=0x%x, fsdata=%p, %d subdirs\n", dentry,
dentry->d_name.len, dentry->d_name.name,
dentry->d_parent->d_name.len, dentry->d_parent->d_name.name,
dentry->d_parent, dentry->d_inode, atomic_read(&dentry->d_count),
- dentry->d_flags, dentry->d_flags, dentry->d_fsdata, subdirs);
+ dentry->d_flags, dentry->d_fsdata, subdirs);
if (dentry->d_inode != NULL)
ll_dump_inode(dentry->d_inode);
if (lmd->lmd_profile) {
struct lustre_profile *lprof;
struct config_llog_instance cfg;
- int len;
+ char ll_instance[sizeof(sb) * 2 + 1];
if (lmd->lmd_mds[0] == '\0') {
CERROR("no mds name\n");
/* generate a string unique to this super, let's try
the address of the super itself.*/
- len = (sizeof(sb) * 2) + 1;
- OBD_ALLOC(sbi->ll_instance, len);
- if (sbi->ll_instance == NULL)
- GOTO(out_free, err = -ENOMEM);
- sprintf(sbi->ll_instance, "%p", sb);
+ sprintf(ll_instance, "%p", sb);
- cfg.cfg_instance = sbi->ll_instance;
+ cfg.cfg_instance = ll_instance;
cfg.cfg_uuid = sbi->ll_sb_uuid;
cfg.cfg_local_nid = lmd->lmd_local_nid;
err = lustre_process_log(lmd, lmd->lmd_profile, &cfg, 0);
if (osc)
OBD_FREE(osc, strlen(osc) + 1);
OBD_ALLOC(osc, strlen(lprof->lp_osc) +
- strlen(sbi->ll_instance) + 2);
- sprintf(osc, "%s-%s", lprof->lp_osc, sbi->ll_instance);
+ strlen(ll_instance) + 2);
+ sprintf(osc, "%s-%s", lprof->lp_osc, ll_instance);
if (mdc)
OBD_FREE(mdc, strlen(mdc) + 1);
OBD_ALLOC(mdc, strlen(lprof->lp_mdc) +
- strlen(sbi->ll_instance) + 2);
- sprintf(mdc, "%s-%s", lprof->lp_mdc, sbi->ll_instance);
+ strlen(ll_instance) + 2);
+ sprintf(mdc, "%s-%s", lprof->lp_mdc, ll_instance);
}
if (!osc) {
out_free:
if (sbi->ll_lmd) {
- int len = strlen(sbi->ll_lmd->lmd_profile) + sizeof("-clean")+1;
- int err;
-
- if (sbi->ll_instance != NULL) {
- char * cln_prof;
- struct config_llog_instance cfg;
-
- cfg.cfg_instance = sbi->ll_instance;
- cfg.cfg_uuid = sbi->ll_sb_uuid;
-
- OBD_ALLOC(cln_prof, len);
- sprintf(cln_prof, "%s-clean", sbi->ll_lmd->lmd_profile);
-
- err = lustre_process_log(sbi->ll_lmd, cln_prof, &cfg,0);
- if (err < 0) {
- CERROR("Unable to process log: %s\n", cln_prof);
- lustre_manual_cleanup(sbi);
- }
- OBD_FREE(cln_prof, len);
- OBD_FREE(sbi->ll_instance, strlen(sbi->ll_instance)+ 1);
- }
+ lustre_manual_cleanup(sbi);
OBD_FREE(sbi->ll_lmd, sizeof(*sbi->ll_lmd));
}
lustre_free_sbi(sb);
lustre_common_put_super(sb);
if (sbi->ll_lmd != NULL) {
-#if 0
- char * cln_prof;
- int len = strlen(sbi->ll_lmd->lmd_profile) + sizeof("-clean")+1;
- int err;
- struct config_llog_instance cfg;
-
- if (force_umount) {
- CERROR("force umount, doing manual cleanup\n");
- lustre_manual_cleanup(sbi);
- GOTO(free_lmd, 0);
- }
-
- cfg.cfg_instance = sbi->ll_instance;
- cfg.cfg_uuid = sbi->ll_sb_uuid;
-
- OBD_ALLOC(cln_prof, len);
- sprintf(cln_prof, "%s-clean", sbi->ll_lmd->lmd_profile);
-
- err = lustre_process_log(sbi->ll_lmd, cln_prof, &cfg, 0);
- if (err < 0) {
- CERROR("Unable to process log: %s, doing manual cleanup"
- "\n", cln_prof);
- lustre_manual_cleanup(sbi);
- }
-
- OBD_FREE(cln_prof, len);
- free_lmd:
-#else
lustre_manual_cleanup(sbi);
-#endif
OBD_FREE(sbi->ll_lmd, sizeof(*sbi->ll_lmd));
- OBD_FREE(sbi->ll_instance, strlen(sbi->ll_instance) + 1);
}
lustre_free_sbi(sb);