CWARN("1a: create a log with name: %s\n", name);
LASSERT(ctxt);
- rc = llog_create(NULL, ctxt, &llh, NULL, name);
+ rc = llog_open_create(NULL, ctxt, &llh, NULL, name);
if (rc) {
CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
llog_ctxt_put(ctxt);
ENTRY;
CWARN("2a: re-open a log with name: %s\n", name);
- rc = llog_create(NULL, ctxt, llh, NULL, name);
+ rc = llog_open(NULL, ctxt, llh, NULL, name, LLOG_OPEN_EXISTS);
if (rc) {
CERROR("2a: re-open log with name %s failed: %d\n", name, rc);
GOTO(out, rc);
sprintf(name, "%x", llog_test_rand+1);
CWARN("4a: create a catalog log with name: %s\n", name);
- rc = llog_create(NULL, ctxt, &cath, NULL, name);
+ rc = llog_open_create(NULL, ctxt, &cath, NULL, name);
if (rc) {
CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
GOTO(out, rc);
out:
CWARN("4f: put newly-created catalog\n");
- rc = llog_cat_put(NULL, cath);
+ rc = llog_cat_close(NULL, cath);
ctxt_release:
llog_ctxt_put(ctxt);
if (rc)
lmr.lmr_hdr.lrh_type = 0xf00f00;
CWARN("5a: re-open catalog by id\n");
- rc = llog_create(NULL, ctxt, &llh, &cat_logid, NULL);
+ rc = llog_open(NULL, ctxt, &llh, &cat_logid, NULL, LLOG_OPEN_EXISTS);
if (rc) {
CERROR("5a: llog_create with logid failed: %d\n", rc);
GOTO(out, rc);
out:
CWARN("5: close re-opened catalog\n");
if (llh)
- rc = llog_cat_put(NULL, llh);
+ rc = llog_cat_close(NULL, llh);
if (rc)
CERROR("1b: close log %s failed: %d\n", name, rc);
llog_ctxt_put(ctxt);
}
nctxt = llog_get_context(mgc_obd, LLOG_CONFIG_REPL_CTXT);
- rc = llog_create(NULL, nctxt, &llh, NULL, name);
+ rc = llog_open(NULL, nctxt, &llh, NULL, name, LLOG_OPEN_EXISTS);
if (rc) {
CERROR("6: llog_create failed %d\n", rc);
llog_ctxt_put(nctxt);
CWARN("7: create a log with name: %s\n", name);
LASSERT(ctxt);
- rc = llog_create(NULL, ctxt, &llh, NULL, name);
+ rc = llog_open_create(NULL, ctxt, &llh, NULL, name);
if (rc) {
CERROR("7: llog_create with name %s failed: %d\n", name, rc);
GOTO(ctxt_release, rc);
rc = llog_destroy(NULL, llh);
if (rc)
CERROR("7: llog_destroy failed: %d\n", rc);
- else
- llog_free_handle(llh);
+ llog_close(NULL, llh);
ctxt_release:
llog_ctxt_put(ctxt);
RETURN(rc);