From 1977cfc0e3330e9e998aac82cbe258bc93a0647f Mon Sep 17 00:00:00 2001 From: Henri Doreau Date: Thu, 28 Apr 2016 13:01:16 +0200 Subject: [PATCH] LU-8079 llog: Remove llog_cat_init_and_process Unlike name suggests, this function does no longer process the log but only initialize it. Replace it by direct calls to the function it wraps. Signed-off-by: Henri Doreau Change-Id: Ib48e7d4cb15a2433cc07c6760e25450a9aa0a3b3 Reviewed-on: http://review.whamcloud.com/19850 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/include/lustre_log.h | 3 --- lustre/lod/lod_sub_object.c | 2 +- lustre/mdd/mdd_device.c | 6 +++--- lustre/obdclass/llog_cat.c | 14 -------------- lustre/osp/osp_sync.c | 2 +- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/lustre/include/lustre_log.h b/lustre/include/lustre_log.h index d31a1d1..28dcbf2 100644 --- a/lustre/include/lustre_log.h +++ b/lustre/include/lustre_log.h @@ -163,9 +163,6 @@ __u64 llog_cat_size(const struct lu_env *env, struct llog_handle *cat_llh); int llog_cat_reverse_process(const struct lu_env *env, struct llog_handle *cat_llh, llog_cb_t cb, void *data); -int llog_cat_init_and_process(const struct lu_env *env, - struct llog_handle *llh); - /* llog_obd.c */ int llog_setup(const struct lu_env *env, struct obd_device *obd, struct obd_llog_group *olg, int index, diff --git a/lustre/lod/lod_sub_object.c b/lustre/lod/lod_sub_object.c index 61bb9fc..4096bf5 100644 --- a/lustre/lod/lod_sub_object.c +++ b/lustre/lod/lod_sub_object.c @@ -986,7 +986,7 @@ int lod_sub_prep_llog(const struct lu_env *env, struct lod_device *lod, LASSERT(lgh != NULL); - rc = llog_cat_init_and_process(env, lgh); + rc = llog_init_handle(env, lgh, LLOG_F_IS_CAT, NULL); if (rc != 0) GOTO(out_close, rc); diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 35a4529..93b0c91 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -340,7 +340,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env, if (rc) GOTO(out_cleanup, rc); - rc = llog_cat_init_and_process(env, ctxt->loc_handle); + rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL); if (rc) GOTO(out_close, rc); @@ -376,7 +376,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env, 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_cat_init_and_process(env, uctxt->loc_handle); + rc = llog_init_handle(env, uctxt->loc_handle, LLOG_F_IS_CAT, NULL); if (rc) GOTO(out_uclose, rc); @@ -836,7 +836,7 @@ static int mdd_hsm_actions_llog_init(const struct lu_env *env, GOTO(out_cleanup, rc); } - rc = llog_cat_init_and_process(env, ctxt->loc_handle); + rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL); if (rc) GOTO(out_close, rc); diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c index 5fdee1f7..921c9cb 100644 --- a/lustre/obdclass/llog_cat.c +++ b/lustre/obdclass/llog_cat.c @@ -1070,17 +1070,3 @@ int llog_cat_cleanup(const struct lu_env *env, struct llog_handle *cathandle, index, POSTID(&cathandle->lgh_id.lgl_oi)); return rc; } - -/* helper to initialize catalog llog and process it to cancel */ -int llog_cat_init_and_process(const struct lu_env *env, - struct llog_handle *llh) -{ - int rc; - - rc = llog_init_handle(env, llh, LLOG_F_IS_CAT, NULL); - if (rc) - RETURN(rc); - - RETURN(0); -} -EXPORT_SYMBOL(llog_cat_init_and_process); diff --git a/lustre/osp/osp_sync.c b/lustre/osp/osp_sync.c index d7520f3..2c74443 100644 --- a/lustre/osp/osp_sync.c +++ b/lustre/osp/osp_sync.c @@ -1313,7 +1313,7 @@ static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d) LASSERT(lgh != NULL); ctxt->loc_handle = lgh; - rc = llog_cat_init_and_process(env, lgh); + rc = llog_init_handle(env, lgh, LLOG_F_IS_CAT, NULL); if (rc) GOTO(out_close, rc); -- 1.8.3.1