From: John L. Hammond Date: Fri, 5 Sep 2014 17:23:14 +0000 (-0500) Subject: LU-2675 llog: remove obd_llog_init() and obd_llod_finish() X-Git-Tag: 2.6.90~67 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9711e0dff8dcf2c7d454245461208124e819bdb6 LU-2675 llog: remove obd_llog_init() and obd_llod_finish() Since the OBD methods obd_llog_init() and obd_llod_finish() are only called from MDC we remove them and just call mdc_llog_init() and mdc_llog_finish() directly. Also simplify the prototypes the latter functions according to their uses. Signed-off-by: John L. Hammond Change-Id: I56f906eacedaa4e2f90742fb129b4d578751a524 Reviewed-on: http://review.whamcloud.com/11781 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Bob Glossman Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/lustre_log.h b/lustre/include/lustre_log.h index 6c87be0..45d8758 100644 --- a/lustre/include/lustre_log.h +++ b/lustre/include/lustre_log.h @@ -206,11 +206,6 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags); int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_cookie *cookies, int flags); -int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg, - struct obd_device *disk_obd, int *idx); - -int obd_llog_finish(struct obd_device *obd, int count); - /* llog_ioctl.c */ struct obd_ioctl_data; int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd, diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 60acd33..d85d984 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -965,11 +965,6 @@ struct obd_ops { int (*o_init_export)(struct obd_export *exp); int (*o_destroy_export)(struct obd_export *exp); - /* llog related obd_methods */ - int (*o_llog_init)(struct obd_device *obd, struct obd_llog_group *grp, - struct obd_device *disk_obd, int *idx); - int (*o_llog_finish)(struct obd_device *obd, int count); - int (*o_import_event)(struct obd_device *, struct obd_import *, enum obd_import_event); diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 0ab1d70..032f88f 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -2845,6 +2845,39 @@ struct ldlm_valblock_ops inode_lvbo = { .lvbo_free = mdc_resource_inode_free }; +static int mdc_llog_init(struct obd_device *obd) +{ + struct obd_llog_group *olg = &obd->obd_olg; + struct llog_ctxt *ctxt; + int rc; + + ENTRY; + + rc = llog_setup(NULL, obd, olg, LLOG_CHANGELOG_REPL_CTXT, obd, + &llog_client_ops); + if (rc < 0) + RETURN(rc); + + ctxt = llog_group_get_ctxt(olg, LLOG_CHANGELOG_REPL_CTXT); + llog_initiator_connect(ctxt); + llog_ctxt_put(ctxt); + + RETURN(0); +} + +static void mdc_llog_finish(struct obd_device *obd) +{ + struct llog_ctxt *ctxt; + + ENTRY; + + ctxt = llog_get_context(obd, LLOG_CHANGELOG_REPL_CTXT); + if (ctxt != NULL) + llog_cleanup(NULL, ctxt); + + EXIT; +} + static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg) { struct client_obd *cli = &obd->u.cli; @@ -2880,7 +2913,7 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg) obd->obd_namespace->ns_lvbo = &inode_lvbo; - rc = obd_llog_init(obd, &obd->obd_olg, obd, NULL); + rc = mdc_llog_init(obd); if (rc) { mdc_cleanup(obd); CERROR("failed to setup llogging subsystems\n"); @@ -2944,10 +2977,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) ptlrpc_lprocfs_unregister_obd(obd); lprocfs_obd_cleanup(obd); lprocfs_free_md_stats(obd); - - rc = obd_llog_finish(obd, 0); - if (rc != 0) - CERROR("failed to cleanup llogging subsystems\n"); + mdc_llog_finish(obd); break; } RETURN(rc); @@ -2965,42 +2995,6 @@ static int mdc_cleanup(struct obd_device *obd) return client_obd_cleanup(obd); } - -static int mdc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, - struct obd_device *tgt, int *index) -{ - struct llog_ctxt *ctxt; - int rc; - - ENTRY; - - LASSERT(olg == &obd->obd_olg); - - rc = llog_setup(NULL, obd, olg, LLOG_CHANGELOG_REPL_CTXT, tgt, - &llog_client_ops); - if (rc) - RETURN(rc); - - ctxt = llog_group_get_ctxt(olg, LLOG_CHANGELOG_REPL_CTXT); - llog_initiator_connect(ctxt); - llog_ctxt_put(ctxt); - - RETURN(0); -} - -static int mdc_llog_finish(struct obd_device *obd, int count) -{ - struct llog_ctxt *ctxt; - - ENTRY; - - ctxt = llog_get_context(obd, LLOG_CHANGELOG_REPL_CTXT); - if (ctxt) - llog_cleanup(NULL, ctxt); - - RETURN(0); -} - static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf) { struct lustre_cfg *lcfg = buf; @@ -3119,8 +3113,6 @@ struct obd_ops mdc_obd_ops = { .o_fid_fini = client_fid_fini, .o_fid_alloc = mdc_fid_alloc, .o_import_event = mdc_import_event, - .o_llog_init = mdc_llog_init, - .o_llog_finish = mdc_llog_finish, .o_get_info = mdc_get_info, .o_process_config = mdc_process_config, .o_get_uuid = mdc_get_uuid, diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index 2761698..1b4f541 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -246,31 +246,6 @@ int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, } EXPORT_SYMBOL(llog_cancel); -int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg, - struct obd_device *disk_obd, int *index) -{ - int rc; - ENTRY; - OBD_CHECK_DT_OP(obd, llog_init, 0); - OBD_COUNTER_INCREMENT(obd, llog_init); - - rc = OBP(obd, llog_init)(obd, olg, disk_obd, index); - RETURN(rc); -} -EXPORT_SYMBOL(obd_llog_init); - -int obd_llog_finish(struct obd_device *obd, int count) -{ - int rc; - ENTRY; - OBD_CHECK_DT_OP(obd, llog_finish, 0); - OBD_COUNTER_INCREMENT(obd, llog_finish); - - rc = OBP(obd, llog_finish)(obd, count); - RETURN(rc); -} -EXPORT_SYMBOL(obd_llog_finish); - /* context key constructor/destructor: llog_key_init, llog_key_fini */ LU_KEY_INIT_FINI(llog, struct llog_thread_info); /* context key: llog_thread_key */ diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index 2171404..a4541cf 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -436,8 +436,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, find_cbdata); LPROCFS_OBD_OP_INIT(num_private_stats, stats, init_export); LPROCFS_OBD_OP_INIT(num_private_stats, stats, destroy_export); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, llog_init); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, llog_finish); LPROCFS_OBD_OP_INIT(num_private_stats, stats, import_event); LPROCFS_OBD_OP_INIT(num_private_stats, stats, notify); LPROCFS_OBD_OP_INIT(num_private_stats, stats, health_check);