From: John L. Hammond Date: Tue, 27 Mar 2018 17:17:10 +0000 (-0500) Subject: LU-10855 llog: use llog_common_cat_ops X-Git-Tag: 2.11.55~46 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3e61bbbcd4baaac76a67093404b60810261812e0 LU-10855 llog: use llog_common_cat_ops Remove changelog_orig_logops, hsm_actions_logops, and osp_mds_ost_orig_logops, replacing each with llog_common_cat_ops. Signed-off-by: John L. Hammond Change-Id: Ia19337350452f9793b3ea9a56343ef3a065c1f83 Reviewed-on: https://review.whamcloud.com/31812 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index fd7dfda..ac5ee30 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -373,8 +373,6 @@ static int llog_changelog_cancel(const struct lu_env *env, RETURN(rc); } -static struct llog_operations changelog_orig_logops; - static int mdd_changelog_write_header(const struct lu_env *env, struct mdd_device *mdd, int markerflags); @@ -439,7 +437,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env, OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt); obd->obd_lvfs_ctxt.dt = mdd->mdd_bottom; rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CHANGELOG_ORIG_CTXT, - obd, &changelog_orig_logops); + obd, &llog_common_cat_ops); if (rc) { CERROR("%s: changelog llog setup failed: rc = %d\n", obd->obd_name, rc); @@ -472,7 +470,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env, /* setup user changelog */ rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CHANGELOG_USER_ORIG_CTXT, - obd, &changelog_orig_logops); + obd, &llog_common_cat_ops); if (rc) { CERROR("%s: changelog users llog setup failed: rc = %d\n", obd->obd_name, rc); @@ -487,9 +485,6 @@ static int mdd_changelog_llog_init(const struct lu_env *env, if (rc) GOTO(out_ucleanup, rc); - uctxt->loc_handle->lgh_logops->lop_add = llog_cat_add_rec; - uctxt->loc_handle->lgh_logops->lop_declare_add = llog_cat_declare_add_rec; - rc = llog_init_handle(env, uctxt->loc_handle, LLOG_F_IS_CAT, NULL); if (rc) GOTO(out_uclose, rc); @@ -995,9 +990,6 @@ out: return rc; } - -static struct llog_operations hsm_actions_logops; - /** * set llog methods and create LLOG_AGENT_ORIG_CTXT llog * object in obd_device @@ -1014,7 +1006,7 @@ static int mdd_hsm_actions_llog_init(const struct lu_env *env, obd->obd_lvfs_ctxt.dt = m->mdd_bottom; rc = llog_setup(env, obd, &obd->obd_olg, LLOG_AGENT_ORIG_CTXT, - obd, &hsm_actions_logops); + obd, &llog_common_cat_ops); if (rc) { CERROR("%s: hsm actions llog setup failed: rc = %d\n", obd->obd_name, rc); @@ -1990,14 +1982,6 @@ static int __init mdd_init(void) if (rc) return rc; - changelog_orig_logops = llog_osd_ops; - changelog_orig_logops.lop_add = llog_cat_add_rec; - changelog_orig_logops.lop_declare_add = llog_cat_declare_add_rec; - - hsm_actions_logops = llog_osd_ops; - hsm_actions_logops.lop_add = llog_cat_add_rec; - hsm_actions_logops.lop_declare_add = llog_cat_declare_add_rec; - rc = class_register_type(&mdd_obd_device_ops, NULL, true, NULL, LUSTRE_MDD_NAME, &mdd_device_type); if (rc) diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index b0dfd64..7c63087 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -1907,8 +1907,6 @@ static struct obd_ops osp_obd_device_ops = { .o_fid_alloc = osp_fid_alloc, }; -struct llog_operations osp_mds_ost_orig_logops; - static struct obd_type sym; /** @@ -1950,11 +1948,6 @@ static int __init osp_init(void) return rc; } - /* Note: add_rec/delcare_add_rec will be only used by catalogs */ - osp_mds_ost_orig_logops = llog_osd_ops; - osp_mds_ost_orig_logops.lop_add = llog_cat_add_rec; - osp_mds_ost_orig_logops.lop_declare_add = llog_cat_declare_add_rec; - /* create "osc" entry for compatibility purposes */ dname.name = "osc"; dname.len = strlen(dname.name); diff --git a/lustre/osp/osp_internal.h b/lustre/osp/osp_internal.h index 9b052e8..80cdad5 100644 --- a/lustre/osp/osp_internal.h +++ b/lustre/osp/osp_internal.h @@ -686,7 +686,6 @@ typedef int (*osp_update_interpreter_t)(const struct lu_env *env, /* osp_dev.c */ void osp_update_last_id(struct osp_device *d, u64 objid); -extern struct llog_operations osp_mds_ost_orig_logops; /* osp_trans.c */ int osp_insert_async_request(const struct lu_env *env, enum update_type op, diff --git a/lustre/osp/osp_sync.c b/lustre/osp/osp_sync.c index 9323107..148317f 100644 --- a/lustre/osp/osp_sync.c +++ b/lustre/osp/osp_sync.c @@ -1356,7 +1356,7 @@ static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d) rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, d->opd_storage->dd_lu_dev.ld_obd, - &osp_mds_ost_orig_logops); + &llog_common_cat_ops); if (rc) RETURN(rc);