X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmgc%2Flibmgc.c;h=4ba5fe3e041fee73f2b60f3d493d4201e9cbe004;hb=187a94923310521cc0dd37e52a461a1fd3c3b27a;hp=9c2bb9b60f50e5afb98aabb1b99ebb96e1cce37a;hpb=65701b4a30efdb695776bcf690a2b3cabc928da1;p=fs%2Flustre-release.git diff --git a/lustre/mgc/libmgc.c b/lustre/mgc/libmgc.c index 9c2bb9b..4ba5fe3 100644 --- a/lustre/mgc/libmgc.c +++ b/lustre/mgc/libmgc.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Whamcloud, Inc. + * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -44,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 @@ -126,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 = {