Whamcloud - gitweb
LU-1302 llog: pass lu_env to the llog callback
authorMikhail Pershin <tappro@whamcloud.com>
Wed, 15 Aug 2012 11:47:20 +0000 (15:47 +0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 4 Sep 2012 18:21:02 +0000 (14:21 -0400)
- Pass lu_env to he llog callback.
- Move cat_cancel_cb() to llog_cat.c to be with all
  other catalog functions.

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Iedbc7953b461ba52b52680d7d709d27c6581f934
Reviewed-on: http://review.whamcloud.com/3649
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
17 files changed:
lustre/include/lustre_log.h
lustre/mdc/mdc_request.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_lproc.c
lustre/mds/mds_log.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_llog.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_internal.h
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_obd.c
lustre/obdclass/llog_test.c
lustre/obdclass/obd_config.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_log.c
lustre/ptlrpc/sec_config.c

index c5055aa..253bafd 100644 (file)
@@ -111,7 +111,8 @@ static inline void fid_to_logid(struct lu_fid *fid, struct llog_logid *id)
 struct llog_handle;
 
 /* llog.c  -  general API */
-typedef int (*llog_cb_t)(struct llog_handle *, struct llog_rec_hdr *, void *);
+typedef int (*llog_cb_t)(const struct lu_env *env, struct llog_handle *lgh,
+                        struct llog_rec_hdr *rec, void *data);
 typedef int (*llog_fill_rec_cb_t)(struct llog_rec_hdr *rec, void *data);
 extern struct llog_handle *llog_alloc_handle(void);
 int llog_init_handle(struct llog_handle *handle, int flags,
@@ -174,6 +175,8 @@ struct llog_process_cat_args {
         void                *lpca_arg;
 };
 
+int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
+                 struct llog_rec_hdr *rec, void *data);
 int llog_cat_put(struct llog_handle *cathandle);
 int llog_cat_add_rec(struct llog_handle *cathandle, struct llog_rec_hdr *rec,
                      struct llog_cookie *reccookie, void *buf);
index 30ec407..7020c3b 100644 (file)
@@ -1221,8 +1221,8 @@ struct changelog_show {
         struct obd_device *cs_obd;
 };
 
-static int changelog_show_cb(struct llog_handle *llh, struct llog_rec_hdr *hdr,
-                             void *data)
+static int changelog_show_cb(const struct lu_env *env, struct llog_handle *llh,
+                            struct llog_rec_hdr *hdr, void *data)
 {
         struct changelog_show *cs = data;
         struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
index 6f1b14e..cc2324c 100644 (file)
@@ -131,8 +131,8 @@ static void mdd_device_shutdown(const struct lu_env *env,
         EXIT;
 }
 
-static int changelog_init_cb(struct llog_handle *llh, struct llog_rec_hdr *hdr,
-                             void *data)
+static int changelog_init_cb(const struct lu_env *env, struct llog_handle *llh,
+                            struct llog_rec_hdr *hdr, void *data)
 {
         struct mdd_device *mdd = (struct mdd_device *)data;
         struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
@@ -151,8 +151,9 @@ static int changelog_init_cb(struct llog_handle *llh, struct llog_rec_hdr *hdr,
         RETURN(LLOG_PROC_BREAK);
 }
 
-static int changelog_user_init_cb(struct llog_handle *llh,
-                                  struct llog_rec_hdr *hdr, void *data)
+static int changelog_user_init_cb(const struct lu_env *env,
+                                 struct llog_handle *llh,
+                                 struct llog_rec_hdr *hdr, void *data)
 {
         struct mdd_device *mdd = (struct mdd_device *)data;
         struct llog_changelog_user_rec *rec =
@@ -1428,7 +1429,6 @@ struct mdd_changelog_user_data {
         __u32 mcud_usercount;
         int   mcud_found:1;
         struct mdd_device   *mcud_mdd;
-        const struct lu_env *mcud_env;
 };
 #define MCUD_UNREGISTER -1LL
 
@@ -1436,13 +1436,14 @@ struct mdd_changelog_user_data {
  * 1. Find the smallest record everyone is willing to purge
  * 2. Update the last purgeable record for this user
  */
-static int mdd_changelog_user_purge_cb(struct llog_handle *llh,
-                                       struct llog_rec_hdr *hdr, void *data)
+static int mdd_changelog_user_purge_cb(const struct lu_env *env,
+                                      struct llog_handle *llh,
+                                      struct llog_rec_hdr *hdr, void *data)
 {
-        struct llog_changelog_user_rec *rec;
-        struct mdd_changelog_user_data *mcud =
-                (struct mdd_changelog_user_data *)data;
-        int rc;
+       struct llog_changelog_user_rec  *rec;
+       struct mdd_changelog_user_data  *mcud = data;
+       int                              rc;
+
         ENTRY;
 
         LASSERT(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN);
@@ -1479,17 +1480,17 @@ static int mdd_changelog_user_purge_cb(struct llog_handle *llh,
 
                 /* XXX This is a workaround for the deadlock of changelog
                  * adding vs. changelog cancelling. LU-81. */
-                th = mdd_trans_create(mcud->mcud_env, mdd);
+               th = mdd_trans_create(env, mdd);
                 if (IS_ERR(th)) {
                         CERROR("Cannot get thandle\n");
                         RETURN(-ENOMEM);
                 }
 
-               rc = mdd_declare_llog_cancel(mcud->mcud_env, mdd, th);
+               rc = mdd_declare_llog_cancel(env, mdd, th);
                 if (rc)
                         GOTO(stop, rc);
 
-                rc = mdd_trans_start(mcud->mcud_env, mdd, th);
+               rc = mdd_trans_start(env, mdd, th);
                 if (rc)
                         GOTO(stop, rc);
 
@@ -1499,7 +1500,7 @@ static int mdd_changelog_user_purge_cb(struct llog_handle *llh,
                         mcud->mcud_usercount--;
 
 stop:
-                mdd_trans_stop(mcud->mcud_env, mdd, 0, th);
+               mdd_trans_stop(env, mdd, 0, th);
                 RETURN(rc);
         }
 
@@ -1532,7 +1533,6 @@ static int mdd_changelog_user_purge(const struct lu_env *env,
         data.mcud_usercount = 0;
         data.mcud_endrec = endrec;
         data.mcud_mdd = mdd;
-        data.mcud_env = env;
         cfs_spin_lock(&mdd->mdd_cl.mc_lock);
         endrec = mdd->mdd_cl.mc_index;
         cfs_spin_unlock(&mdd->mdd_cl.mc_lock);
index 48e2cd1..a85c9fc 100644 (file)
@@ -198,8 +198,9 @@ struct cucb_data {
         int idx;
 };
 
-static int lprocfs_changelog_users_cb(struct llog_handle *llh,
-                                      struct llog_rec_hdr *hdr, void *data)
+static int lprocfs_changelog_users_cb(const struct lu_env *env,
+                                     struct llog_handle *llh,
+                                     struct llog_rec_hdr *hdr, void *data)
 {
         struct llog_changelog_user_rec *rec;
         struct cucb_data *cucb = (struct cucb_data *)data;
index 9168fdd..168e81a 100644 (file)
@@ -112,8 +112,9 @@ static struct llog_operations mds_size_repl_logops = {
 
 static struct llog_operations changelog_orig_logops;
 
-static int llog_changelog_cancel_cb(struct llog_handle *llh,
-                                    struct llog_rec_hdr *hdr, void *data)
+static int llog_changelog_cancel_cb(const struct lu_env *env,
+                                   struct llog_handle *llh,
+                                   struct llog_rec_hdr *hdr, void *data)
 {
         struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
         struct llog_cookie cookie;
index a24e48a..ae89379 100644 (file)
@@ -1576,8 +1576,8 @@ static int mgc_llog_is_empty(struct obd_device *obd, struct llog_ctxt *ctxt,
         return(rc <= 1);
 }
 
-static int mgc_copy_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                            void *data)
+static int mgc_copy_handler(const struct lu_env *env, struct llog_handle *llh,
+                           struct llog_rec_hdr *rec, void *data)
 {
         struct llog_rec_hdr local_rec = *rec;
         struct llog_handle *local_llh = (struct llog_handle *)data;
index 58d892e..883c251 100644 (file)
@@ -136,10 +136,10 @@ struct mgs_fsdb_handler_data
 */
 /* It might be better to have a separate db file, instead of parsing the info
    out of the client log.  This is slow and potentially error-prone. */
-static int mgs_fsdb_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                            void *data)
+static int mgs_fsdb_handler(const struct lu_env *env, struct llog_handle *llh,
+                           struct llog_rec_hdr *rec, void *data)
 {
-        struct mgs_fsdb_handler_data *d = (struct mgs_fsdb_handler_data *) data;
+       struct mgs_fsdb_handler_data *d = data;
         struct fs_db *fsdb = d->fsdb;
         int cfg_len = rec->lrh_len;
         char *cfg_buf = (char*) (rec + 1);
@@ -614,10 +614,11 @@ struct mgs_modify_lookup {
         int               mml_modified;
 };
 
-static int mgs_modify_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                              void *data)
+static int mgs_modify_handler(const struct lu_env *env,
+                             struct llog_handle *llh,
+                             struct llog_rec_hdr *rec, void *data)
 {
-        struct mgs_modify_lookup *mml = (struct mgs_modify_lookup *)data;
+       struct mgs_modify_lookup *mml = data;
         struct cfg_marker *marker;
         struct lustre_cfg *lcfg = (struct lustre_cfg *)(rec + 1);
         int cfg_len = rec->lrh_len - sizeof(struct llog_rec_hdr) -
@@ -1087,9 +1088,9 @@ static int mgs_write_log_osc_to_lov(struct obd_device *obd, struct fs_db *fsdb,
 static void name_create_mdt_and_lov(char **logname, char **lovname,
                                     struct fs_db *fsdb, int i);
 
-static int mgs_steal_llog_handler(struct llog_handle *llh,
-                                  struct llog_rec_hdr *rec,
-                                  void *data)
+static int mgs_steal_llog_handler(const struct lu_env *env,
+                                 struct llog_handle *llh,
+                                 struct llog_rec_hdr *rec, void *data)
 {
         struct obd_device * obd;
         struct mgs_target_info *mti, *tmti;
@@ -2295,11 +2296,11 @@ struct mgs_srpc_read_data {
         int             msrd_skip;
 };
 
-static int mgs_srpc_read_handler(struct llog_handle *llh,
-                                 struct llog_rec_hdr *rec,
-                                 void *data)
+static int mgs_srpc_read_handler(const struct lu_env *env,
+                                struct llog_handle *llh,
+                                struct llog_rec_hdr *rec, void *data)
 {
-        struct mgs_srpc_read_data *msrd = (struct mgs_srpc_read_data *) data;
+       struct mgs_srpc_read_data *msrd = data;
         struct cfg_marker         *marker;
         struct lustre_cfg         *lcfg = (struct lustre_cfg *)(rec + 1);
         char                      *svname, *param;
index fdd4a33..8bde1b1 100644 (file)
@@ -333,8 +333,8 @@ repeat:
 
                         /* if set, process the callback on this record */
                         if (ext2_test_bit(index, llh->llh_bitmap)) {
-                                rc = lpi->lpi_cb(loghandle, rec,
-                                                 lpi->lpi_cbdata);
+                               rc = lpi->lpi_cb(lpi->lpi_env, loghandle, rec,
+                                                lpi->lpi_cbdata);
                                 last_called_index = index;
                                 if (rc == LLOG_PROC_BREAK) {
                                         GOTO(out, rc);
@@ -513,9 +513,9 @@ int llog_reverse_process(const struct lu_env *env,
                                rec = (void *)tail - tail->lrt_len +
                                      sizeof(*tail);
 
-                                rc = cb(loghandle, rec, data);
-                                if (rc == LLOG_PROC_BREAK) {
-                                        GOTO(out, rc);
+                               rc = cb(env, loghandle, rec, data);
+                               if (rc == LLOG_PROC_BREAK) {
+                                       GOTO(out, rc);
                                } else if (rc == LLOG_DEL_RECORD) {
                                        llog_cancel_rec(loghandle,
                                                        tail->lrt_index);
index 51d62e9..bccdfc5 100644 (file)
@@ -361,8 +361,8 @@ int llog_cat_cancel_records(struct llog_handle *cathandle, int count,
 }
 EXPORT_SYMBOL(llog_cat_cancel_records);
 
-int llog_cat_process_cb(struct llog_handle *cat_llh, struct llog_rec_hdr *rec,
-                        void *data)
+int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
+                       struct llog_rec_hdr *rec, void *data)
 {
         struct llog_process_data *d = data;
         struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
@@ -394,11 +394,11 @@ int llog_cat_process_cb(struct llog_handle *cat_llh, struct llog_rec_hdr *rec,
 
                 cd.lpcd_first_idx = d->lpd_startidx;
                 cd.lpcd_last_idx = 0;
-               rc = llog_process(NULL, llh, d->lpd_cb, d->lpd_data, &cd);
+               rc = llog_process(env, llh, d->lpd_cb, d->lpd_data, &cd);
                 /* Continue processing the next log from idx 0 */
                 d->lpd_startidx = 0;
         } else {
-               rc = llog_process(NULL, llh, d->lpd_cb, d->lpd_data, NULL);
+               rc = llog_process(env, llh, d->lpd_cb, d->lpd_data, NULL);
         }
 
         RETURN(rc);
@@ -488,9 +488,9 @@ int llog_cat_process_thread(void *data)
 
         if (cb) {
                rc = llog_cat_process(&env, llh, cb, NULL, 0, 0);
-                if (rc != LLOG_PROC_BREAK && rc != 0)
-                        CERROR("llog_cat_process() failed %d\n", rc);
-                cb(llh, NULL, NULL);
+               if (rc != LLOG_PROC_BREAK && rc != 0)
+                       CERROR("llog_cat_process() failed %d\n", rc);
+               cb(&env, llh, NULL, NULL);
         } else {
                 CWARN("No callback function for recovery\n");
         }
@@ -514,8 +514,9 @@ out:
 EXPORT_SYMBOL(llog_cat_process_thread);
 #endif
 
-static int llog_cat_reverse_process_cb(struct llog_handle *cat_llh,
-                                       struct llog_rec_hdr *rec, void *data)
+static int llog_cat_reverse_process_cb(const struct lu_env *env,
+                                      struct llog_handle *cat_llh,
+                                      struct llog_rec_hdr *rec, void *data)
 {
         struct llog_process_data *d = data;
         struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
@@ -537,7 +538,7 @@ static int llog_cat_reverse_process_cb(struct llog_handle *cat_llh,
                 RETURN(rc);
         }
 
-       rc = llog_reverse_process(NULL, llh, d->lpd_cb, d->lpd_data, NULL);
+       rc = llog_reverse_process(env, llh, d->lpd_cb, d->lpd_data, NULL);
         RETURN(rc);
 }
 
@@ -613,3 +614,61 @@ out:
 
         RETURN(0);
 }
+
+/* callback func for llog_process in llog_obd_origin_setup */
+int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
+                 struct llog_rec_hdr *rec, void *data)
+{
+       struct llog_logid_rec   *lir = (struct llog_logid_rec *)rec;
+       struct llog_handle      *loghandle;
+       struct llog_log_hdr     *llh;
+       int                      rc, index;
+
+       ENTRY;
+
+       if (rec->lrh_type != LLOG_LOGID_MAGIC) {
+               CERROR("%s: invalid record in catalog\n",
+                      loghandle->lgh_ctxt->loc_obd->obd_name);
+               RETURN(-EINVAL);
+       }
+       CDEBUG(D_HA, "processing log "LPX64":%x at index %u of catalog "
+              LPX64"\n", lir->lid_id.lgl_oid, lir->lid_id.lgl_ogen,
+              rec->lrh_index, cathandle->lgh_id.lgl_oid);
+
+       rc = llog_cat_id2handle(cathandle, &loghandle, &lir->lid_id);
+       if (rc) {
+               CERROR("%s: cannot find handle for llog "LPX64"\n",
+                      loghandle->lgh_ctxt->loc_obd->obd_name,
+                      lir->lid_id.lgl_oid);
+               if (rc == -ENOENT) {
+                       index = rec->lrh_index;
+                       goto cat_cleanup;
+               }
+               RETURN(rc);
+       }
+
+       llh = loghandle->lgh_hdr;
+       if ((llh->llh_flags & LLOG_F_ZAP_WHEN_EMPTY) &&
+           (llh->llh_count == 1)) {
+               rc = llog_destroy(loghandle);
+               if (rc)
+                       CERROR("%s: fail to destroy empty log: rc = %d\n",
+                              loghandle->lgh_ctxt->loc_obd->obd_name, rc);
+
+               index = loghandle->u.phd.phd_cookie.lgc_index;
+               llog_free_handle(loghandle);
+
+cat_cleanup:
+               LASSERT(index);
+               llog_cat_set_first_idx(cathandle, index);
+               rc = llog_cancel_rec(cathandle, index);
+               if (rc == 0)
+                       CDEBUG(D_HA,
+                              "cancel log "LPX64":%x at index %u of catalog "
+                              LPX64"\n", lir->lid_id.lgl_oid,
+                              lir->lid_id.lgl_ogen, rec->lrh_index,
+                              cathandle->lgh_id.lgl_oid);
+       }
+
+       RETURN(rc);
+}
index e2aec69..9960237 100644 (file)
@@ -81,8 +81,9 @@ void llog_info_fini(void);
 
 int llog_cat_id2handle(struct llog_handle *cathandle, struct llog_handle **res,
                        struct llog_logid *logid);
-int class_config_dump_handler(struct llog_handle * handle,
-                              struct llog_rec_hdr *rec, void *data);
+int class_config_dump_handler(const struct lu_env *env,
+                             struct llog_handle *handle,
+                             struct llog_rec_hdr *rec, void *data);
 int llog_process_or_fork(const struct lu_env *env,
                         struct llog_handle *loghandle,
                         llog_cb_t cb, void *data, void *catdata, bool fork);
index 8a03dae..6d2383f 100644 (file)
@@ -84,8 +84,8 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
         RETURN(0);
 }
 
-static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
-                         void *data)
+static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
+                        struct llog_rec_hdr *rec, void *data)
 {
         struct obd_ioctl_data *ioc_data = (struct obd_ioctl_data *)data;
         static int l, remains, from, to;
@@ -135,7 +135,7 @@ static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
                                lir->lid_id.lgl_ogen);
                         RETURN(rc);
                 }
-               rc = llog_process(NULL, log_handle, llog_check_cb, NULL, NULL);
+               rc = llog_process(env, log_handle, llog_check_cb, NULL, NULL);
                 llog_close(log_handle);
         } else {
                 switch (rec->lrh_type) {
@@ -174,8 +174,8 @@ static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
         RETURN(rc);
 }
 
-static int llog_print_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
-                         void *data)
+static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
+                        struct llog_rec_hdr *rec, void *data)
 {
         struct obd_ioctl_data *ioc_data = (struct obd_ioctl_data *)data;
         static int l, remains, from, to;
@@ -208,6 +208,7 @@ static int llog_print_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
 
         if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
                 struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
+
                 if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                         CERROR("invalid record in catalog\n");
                         RETURN(-EINVAL);
@@ -262,8 +263,8 @@ out:
 
 }
 
-static int llog_delete_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
-                          void *data)
+static int llog_delete_cb(const struct lu_env *env, struct llog_handle *handle,
+                         struct llog_rec_hdr *rec, void *data)
 {
         struct  llog_logid_rec *lir = (struct llog_logid_rec*)rec;
         int     rc;
index e37b150..8cd7e46 100644 (file)
@@ -290,59 +290,6 @@ int llog_cancel(struct llog_ctxt *ctxt, struct lov_stripe_md *lsm,
 }
 EXPORT_SYMBOL(llog_cancel);
 
-/* callback func for llog_process in llog_obd_origin_setup */
-static int cat_cancel_cb(struct llog_handle *cathandle,
-                          struct llog_rec_hdr *rec, void *data)
-{
-        struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
-        struct llog_handle *loghandle;
-        struct llog_log_hdr *llh;
-        int rc, index;
-        ENTRY;
-
-        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
-                CERROR("invalid record in catalog\n");
-                RETURN(-EINVAL);
-        }
-        CDEBUG(D_HA, "processing log "LPX64":%x at index %u of catalog "
-               LPX64"\n", lir->lid_id.lgl_oid, lir->lid_id.lgl_ogen,
-               rec->lrh_index, cathandle->lgh_id.lgl_oid);
-
-        rc = llog_cat_id2handle(cathandle, &loghandle, &lir->lid_id);
-        if (rc) {
-                CERROR("Cannot find handle for log "LPX64"\n",
-                       lir->lid_id.lgl_oid);
-                if (rc == -ENOENT) {
-                        index = rec->lrh_index;
-                        goto cat_cleanup;
-                }
-                RETURN(rc);
-        }
-
-        llh = loghandle->lgh_hdr;
-        if ((llh->llh_flags & LLOG_F_ZAP_WHEN_EMPTY) &&
-            (llh->llh_count == 1)) {
-                rc = llog_destroy(loghandle);
-                if (rc)
-                        CERROR("failure destroying log in postsetup: %d\n", rc);
-
-                index = loghandle->u.phd.phd_cookie.lgc_index;
-                llog_free_handle(loghandle);
-
-cat_cleanup:
-                LASSERT(index);
-                llog_cat_set_first_idx(cathandle, index);
-                rc = llog_cancel_rec(cathandle, index);
-                if (rc == 0)
-                        CDEBUG(D_HA, "cancel log "LPX64":%x at index %u of catalog "
-                              LPX64"\n", lir->lid_id.lgl_oid,
-                              lir->lid_id.lgl_ogen, rec->lrh_index,
-                              cathandle->lgh_id.lgl_oid);
-        }
-
-        RETURN(rc);
-}
-
 /* lop_setup method for filter/osc */
 // XXX how to set exports
 int llog_obd_origin_setup(struct obd_device *obd, struct obd_llog_group *olg,
index cd642e1..66396f0 100644 (file)
@@ -364,8 +364,8 @@ ctxt_release:
         RETURN(rc);
 }
 
-static int cat_print_cb(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                        void *data)
+static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
+                       struct llog_rec_hdr *rec, void *data)
 {
         struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
 
@@ -380,8 +380,8 @@ static int cat_print_cb(struct llog_handle *llh, struct llog_rec_hdr *rec,
         RETURN(0);
 }
 
-static int plain_print_cb(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                          void *data)
+static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
+                         struct llog_rec_hdr *rec, void *data)
 {
         if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
                 CERROR("log is not plain\n");
@@ -393,8 +393,9 @@ static int plain_print_cb(struct llog_handle *llh, struct llog_rec_hdr *rec,
         RETURN(0);
 }
 
-static int llog_cancel_rec_cb(struct llog_handle *llh, struct llog_rec_hdr *rec,
-                              void *data)
+static int llog_cancel_rec_cb(const struct lu_env *env,
+                             struct llog_handle *llh,
+                             struct llog_rec_hdr *rec, void *data)
 {
         struct llog_cookie cookie;
         static int i = 0;
index 719c64d..c1d87c2 100644 (file)
 #include <obd_class.h>
 #include <obd.h>
 #endif
-#include <lustre_log.h>
-#include <lprocfs_status.h>
-#include <libcfs/list.h>
 #include <lustre_param.h>
 
+#include "llog_internal.h"
+
 static cfs_hash_ops_t uuid_hash_ops;
 static cfs_hash_ops_t nid_hash_ops;
 static cfs_hash_ops_t nid_stat_hash_ops;
@@ -1261,9 +1260,6 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 }
 EXPORT_SYMBOL(class_process_proc_param);
 
-int class_config_dump_handler(struct llog_handle * handle,
-                              struct llog_rec_hdr *rec, void *data);
-
 #ifdef __KERNEL__
 extern int lustre_check_exclusion(struct super_block *sb, char *svname);
 #else
@@ -1275,8 +1271,9 @@ extern int lustre_check_exclusion(struct super_block *sb, char *svname);
  * records, change uuids, etc), then class_process_config() resulting
  * net records.
  */
-static int class_config_llog_handler(struct llog_handle * handle,
-                                     struct llog_rec_hdr *rec, void *data)
+static int class_config_llog_handler(const struct lu_env *env,
+                                    struct llog_handle *handle,
+                                    struct llog_rec_hdr *rec, void *data)
 {
         struct config_llog_instance *clli = data;
         int cfg_len = rec->lrh_len;
@@ -1456,7 +1453,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
 out:
         if (rc) {
                 CERROR("Err %d on cfg command:\n", rc);
-                class_config_dump_handler(handle, rec, data);
+               class_config_dump_handler(NULL, handle, rec, data);
         }
         RETURN(rc);
 }
@@ -1500,8 +1497,9 @@ parse_out:
 }
 EXPORT_SYMBOL(class_config_parse_llog);
 
-int class_config_dump_handler(struct llog_handle * handle,
-                              struct llog_rec_hdr *rec, void *data)
+int class_config_dump_handler(const struct lu_env *env,
+                             struct llog_handle *handle,
+                             struct llog_rec_hdr *rec, void *data)
 {
         int cfg_len = rec->lrh_len;
         char *cfg_buf = (char*) (rec + 1);
index 5d1e119..b50e985 100644 (file)
@@ -244,8 +244,9 @@ int filter_log_sz_change(struct llog_handle *cathandle,
 //int filter_get_catalog(struct obd_device *);
 void filter_cancel_cookies_cb(struct obd_device *obd, __u64 transno,
                               void *cb_data, int error);
-int filter_recov_log_mds_ost_cb(struct llog_handle *llh,
-                               struct llog_rec_hdr *rec, void *data);
+int filter_recov_log_mds_ost_cb(const struct lu_env *env,
+                               struct llog_handle *llh,
+                               struct llog_rec_hdr *rec, void *data);
 
 #ifdef LPROCFS
 void filter_tally(struct obd_export *exp, struct page **pages, int nr_pages,
index cd09c7f..1d5f7d9 100644 (file)
@@ -249,8 +249,9 @@ static int filter_recov_log_setattr_cb(struct llog_ctxt *ctxt,
         RETURN(rc);
 }
 
-int filter_recov_log_mds_ost_cb(struct llog_handle *llh,
-                                struct llog_rec_hdr *rec, void *data)
+int filter_recov_log_mds_ost_cb(const struct lu_env *env,
+                               struct llog_handle *llh,
+                               struct llog_rec_hdr *rec, void *data)
 {
         struct llog_ctxt *ctxt = llh->lgh_ctxt;
         struct llog_cookie cookie;
index d12d7b3..fb44b2d 100644 (file)
@@ -1082,9 +1082,9 @@ out_ctx:
         RETURN(rc);
 }
 
-static int local_read_handler(struct llog_handle *llh,
-                              struct llog_rec_hdr *rec,
-                              void *data)
+static int local_read_handler(const struct lu_env *env,
+                             struct llog_handle *llh,
+                             struct llog_rec_hdr *rec, void *data)
 {
         struct sptlrpc_conf  *conf = (struct sptlrpc_conf *) data;
         struct lustre_cfg    *lcfg = (struct lustre_cfg *)(rec + 1);