From 86cb7e80f2a573bb23a10ee9eebe3c7f525bd2d0 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Tue, 27 Mar 2018 12:17:10 -0500 Subject: [PATCH] LU-10855 llog: remove llog_cancel() Remove llog_cancel() and replace its sole use with a direct call to llog_changelog_cancel(). Simplify the prototype of llog_changelog_cancel() according to its use. Signed-off-by: John L. Hammond Change-Id: I32f5adf34ca10b918e5860e03ef0d8028c941697 Reviewed-on: https://review.whamcloud.com/31795 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre/include/lustre_log.h | 4 ---- lustre/mdd/mdd_device.c | 7 +++---- lustre/obdclass/llog_obd.c | 22 ---------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/lustre/include/lustre_log.h b/lustre/include/lustre_log.h index a556e6c..ec4d1f9 100644 --- a/lustre/include/lustre_log.h +++ b/lustre/include/lustre_log.h @@ -171,8 +171,6 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd, int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt); int llog_cleanup(const struct lu_env *env, struct llog_ctxt *); 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); /* llog_ioctl.c */ struct obd_ioctl_data; @@ -203,8 +201,6 @@ struct llog_operations { int (*lop_sync)(struct llog_ctxt *ctxt, struct obd_export *exp, int flags); int (*lop_cleanup)(const struct lu_env *env, struct llog_ctxt *ctxt); - int (*lop_cancel)(const struct lu_env *env, struct llog_ctxt *ctxt, - struct llog_cookie *cookies, int flags); int (*lop_connect)(struct llog_ctxt *ctxt, struct llog_logid *logid, struct llog_gen *gen, struct obd_uuid *uuid); /** diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index a4273cd..90d8e37 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -254,7 +254,7 @@ static int llog_changelog_cancel_cb(const struct lu_env *env, static int llog_changelog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, - struct llog_cookie *cookies, int flags) + long long endrec) { struct llog_handle *cathandle = ctxt->loc_handle; int rc; @@ -265,7 +265,7 @@ static int llog_changelog_cancel(const struct lu_env *env, LASSERT(cathandle->lgh_hdr->llh_flags & LLOG_F_IS_CAT); rc = llog_cat_process(env, cathandle, llog_changelog_cancel_cb, - (void *)cookies, 0, 0); + &endrec, 0, 0); if (rc >= 0) /* 0 or 1 means we're done */ rc = 0; @@ -508,7 +508,7 @@ mdd_changelog_llog_cancel(const struct lu_env *env, struct mdd_device *mdd, changed since the last purge) */ mdd->mdd_cl.mc_starttime = ktime_get(); - rc = llog_cancel(env, ctxt, (struct llog_cookie *)&endrec, 0); + rc = llog_changelog_cancel(env, ctxt, endrec); out: llog_ctxt_put(ctxt); return rc; @@ -1807,7 +1807,6 @@ static int __init mdd_init(void) return rc; changelog_orig_logops = llog_osd_ops; - changelog_orig_logops.lop_cancel = llog_changelog_cancel; changelog_orig_logops.lop_add = llog_cat_add_rec; changelog_orig_logops.lop_declare_add = llog_cat_declare_add_rec; diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index 60b18e0..d4b2d57 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -227,28 +227,6 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags) } EXPORT_SYMBOL(llog_sync); -int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, - struct llog_cookie *cookies, int flags) -{ - int rc; - ENTRY; - - if (!ctxt) { - CERROR("No ctxt\n"); - RETURN(-ENODEV); - } - - if (!ctxt->loc_obd->obd_type || !(ctxt)->loc_logops->lop_cancel) { - CERROR("%s: no lop_cancel operation\n", - ctxt->loc_obd->obd_name); - RETURN(-EOPNOTSUPP); - } - - rc = ctxt->loc_logops->lop_cancel(env, ctxt, cookies, flags); - RETURN(rc); -} -EXPORT_SYMBOL(llog_cancel); - /* context key constructor/destructor: llog_key_init, llog_key_fini */ LU_KEY_INIT_FINI(llog, struct llog_thread_info); /* context key: llog_thread_key */ -- 1.8.3.1