X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmgc%2Flibmgc.c;h=ead0a680465dc29918fbd9d28708625d4eb71264;hb=c52d48bf7838c8d9a886a8865017e150e294d91c;hp=42956d84e82ce0adc5b41138770a4d513086f8fa;hpb=e2af7fb3c91dfb13d34d8e1b2f2df8c09621f768;p=fs%2Flustre-release.git diff --git a/lustre/mgc/libmgc.c b/lustre/mgc/libmgc.c index 42956d8..ead0a68 100644 --- a/lustre/mgc/libmgc.c +++ b/lustre/mgc/libmgc.c @@ -121,25 +121,29 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, ENTRY; LASSERT(olg == &obd->obd_olg); - rc = llog_setup(obd, olg, LLOG_CONFIG_REPL_CTXT, tgt, 0, NULL, - &llog_client_ops); - if (rc == 0) { - ctxt = llog_group_get_ctxt(olg, LLOG_CONFIG_REPL_CTXT); - llog_initiator_connect(ctxt); - llog_ctxt_put(ctxt); - } + rc = llog_setup(NULL, obd, olg, LLOG_CONFIG_REPL_CTXT, tgt, + &llog_client_ops); + if (rc < 0) + RETURN(rc); - RETURN(rc); + ctxt = llog_group_get_ctxt(olg, LLOG_CONFIG_REPL_CTXT); + llog_initiator_connect(ctxt); + llog_ctxt_put(ctxt); + + RETURN(rc); } static int mgc_llog_finish(struct obd_device *obd, int count) { - int rc; - ENTRY; + struct llog_ctxt *ctxt; - rc = llog_cleanup(llog_get_context(obd, LLOG_CONFIG_REPL_CTXT)); + ENTRY; - RETURN(rc); + ctxt = llog_get_context(obd, LLOG_CONFIG_REPL_CTXT); + if (ctxt) + llog_cleanup(NULL, ctxt); + + RETURN(0); } struct obd_ops mgc_obd_ops = {