}
}
+ if (OBT(obd) && OBP(obd, pre_cleanup)) {
+ err = obd_pre_cleanup(obd, flags);
+ if (err)
+ RETURN(err);
+ }
+
if (atomic_read(&obd->obd_refcount) == 1 ||
flags & OBD_OPT_FORCE) {
/* this will stop new connections, and need to
struct llog_handle *llh;
struct obd_device *obd = exp->exp_obd;
int rc, rc2;
+ ENTRY;
- obd->obd_log_exp = class_export_get(exp);
+ if (obd->obd_log_exp == NULL) {
+ CERROR("No log export on obd:%s\n", obd->obd_name);
+ RETURN(-ENOTCONN);
+ }
rc = llog_create(obd, &llh, NULL, name);
if (rc) {
if (rc == 0)
rc = rc2;
- class_export_put(obd->obd_log_exp);
- obd->obd_log_exp = NULL;
RETURN(rc);
}
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp == NULL);
+ LASSERT(obd->obd_log_exp != NULL);
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
}
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- obd->obd_log_exp = class_export_get(exp);
rc = llog_create(obd, &loghandle, logid, name);
if (rc)
out_close:
rc2 = llog_close(loghandle);
- class_export_put(obd->obd_log_exp);
if (!rc)
rc = rc2;
out_pop:
- obd->obd_log_exp = NULL;
pop_ctxt(&saved, &obd->obd_ctxt, NULL);
out:
RETURN(rc);
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp == NULL);
+ LASSERT(obd->obd_log_exp != NULL);
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
GOTO(out, rc = -ENOMEM);
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- obd->obd_log_exp = class_export_get(exp);
rc = llog_create(obd, &loghandle, &body->lgd_logid, NULL);
if (rc)
out_close:
rc2 = llog_close(loghandle);
- class_export_put(obd->obd_log_exp);
- obd->obd_log_exp = NULL;
if (!rc)
rc = rc2;
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp == NULL);
+ LASSERT(obd->obd_log_exp != NULL);
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
GOTO(out, rc = -ENOMEM);
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- obd->obd_log_exp = class_export_get(exp);
rc = llog_create(obd, &loghandle, &body->lgd_logid, NULL);
if (rc)
out_close:
rc2 = llog_close(loghandle);
- class_export_put(obd->obd_log_exp);
- obd->obd_log_exp = NULL;
if (!rc)
rc = rc2;