Whamcloud - gitweb
LU-10855 llog: remove llog_cancel() 95/31795/5
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 27 Mar 2018 17:17:10 +0000 (12:17 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 17 May 2018 02:30:59 +0000 (02:30 +0000)
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 <john.hammond@intel.com>
Change-Id: I32f5adf34ca10b918e5860e03ef0d8028c941697
Reviewed-on: https://review.whamcloud.com/31795
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_log.h
lustre/mdd/mdd_device.c
lustre/obdclass/llog_obd.c

index a556e6c..ec4d1f9 100644 (file)
@@ -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);
        /**
index a4273cd..90d8e37 100644 (file)
@@ -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;
 
index 60b18e0..d4b2d57 100644 (file)
@@ -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 */