X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmgc%2Flibmgc.c;h=ead0a680465dc29918fbd9d28708625d4eb71264;hb=539d4218b8c6d025bb2ebffec313a38b53e08cd1;hp=053921e274e768ccb5c9e743bcda95492ee0024f;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/lustre/mgc/libmgc.c b/lustre/mgc/libmgc.c index 053921e..ead0a68 100644 --- a/lustre/mgc/libmgc.c +++ b/lustre/mgc/libmgc.c @@ -42,9 +42,6 @@ /* Minimal MGC for liblustre: only used to read the config log from the MGS at setup time, no updates. */ -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #define DEBUG_SUBSYSTEM S_MGC #include @@ -124,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 = {