From: nathan Date: Fri, 5 Aug 2005 01:08:40 +0000 (+0000) Subject: Branch b1_4_newconfig2 X-Git-Tag: v1_8_0_110~486^4~175^2~20 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=512b7a1700130a3ec9facd639036daf7efc479c6;p=fs%2Flustre-release.git Branch b1_4_newconfig2 b=6663 mgc_setup should look more like confobd setup than client setup --- diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 9d49d03..6451681 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -43,13 +43,14 @@ #include //#include #include -#include +#include +//#include #include "mgc_internal.h" static int mgc_setup(struct obd_device *obd, obd_count len, void *buf) { struct mgc_obd *mgc = &obd->u.mgc; - struct lprocfs_static_vars lvars; + //struct lprocfs_static_vars lvars; int rc; ENTRY; @@ -63,10 +64,12 @@ static int mgc_setup(struct obd_device *obd, obd_count len, void *buf) rc = mgc_obd_setup(obd, len, buf); if (rc) GOTO(err_rpc_lock, rc); - lprocfs_init_vars(mgc, &lvars); - lprocfs_obd_setup(obd, lvars.obd_vars); - - rc = obd_llog_init(obd, obd, 0, NULL); + //lprocfs_init_vars(mgc, &lvars); + //lprocfs_obd_setup(obd, lvars.obd_vars); + + rc = llog_setup(obd, LLOG_CONFIG_ORIG_CTXT, obd, 0, NULL, + &llog_lvfs_ops); + //rc = obd_llog_init(obd, obd, 0, NULL); if (rc) { mgc_cleanup(obd); CERROR("failed to setup llogging subsystems\n"); @@ -79,31 +82,22 @@ err_rpc_lock: RETURN(rc); } -static int mgc_precleanup(struct obd_device *obd, int stage) +static int mgc_cleanup(struct obd_device *obd) { - int rc = 0; - ENTRY; - - if (stage < 2) - RETURN(0); + struct mgc_obd *mgc = &obd->u.mgc; + int rc; rc = obd_llog_finish(obd, 0); if (rc != 0) CERROR("failed to cleanup llogging subsystems\n"); - RETURN(rc); -} - -static int mgc_cleanup(struct obd_device *obd) -{ - struct mgc_obd *mgc = &obd->u.mgc; - OBD_FREE(mgc->mgc_rpc_lock, sizeof (*mgc->mgc_rpc_lock)); - lprocfs_obd_cleanup(obd); + //lprocfs_obd_cleanup(obd); ptlrpcd_decref(); - return mgc_obd_cleanup(obd); + rc = mgc_obd_cleanup(obd); + return(rc); } static int mgc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, @@ -221,7 +215,6 @@ static int mgc_llog_finish(struct obd_device *obd, int count) struct obd_ops mgc_obd_ops = { .o_owner = THIS_MODULE, .o_setup = mgc_setup, - .o_precleanup = mgc_precleanup, .o_cleanup = mgc_cleanup, .o_add_conn = client_import_add_conn, .o_del_conn = client_import_del_conn, diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 0d095dc..1abaeb0 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -625,12 +625,13 @@ int mgc_fs_setup(struct super_block *sb, struct vfsmount *mnt) goto err_ops; } mgcobd->mgc_configs_dir = dentry; - + #if 0 err = llog_setup(obd, LLOG_CONFIG_ORIG_CTXT, obd, 0, NULL, &llog_lvfs_ops); if (err) goto err_dput; - + #endif + err_pop: pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); return(err);