Because osp_mds_ost_orig_logops and changelog_orig_logops
will be shared by all of the llog ctxt for all OSPs/MDDs
on one node, if we keep changing that during obd_setup
process, the loc_logops might be changed, i.e. lop_add
and lop_declare_add might become zero for a while. So if
other healthy device(like another osp) tried to delcare_add
or add record during the time, it will get ENOTSUPP.(especially
for DNE). So the ops initialization should move to module init.
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I1e46d2163c2431c43c369adb7b3c16e664260a4e
Reviewed-on: http://review.whamcloud.com/4608
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
- changelog_orig_logops = llog_osd_ops;
- changelog_orig_logops.lop_cancel = llog_changelog_cancel;
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CHANGELOG_ORIG_CTXT,
obd, &changelog_orig_logops);
if (rc) {
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CHANGELOG_ORIG_CTXT,
obd, &changelog_orig_logops);
if (rc) {
if (rc)
GOTO(out_cleanup, rc);
if (rc)
GOTO(out_cleanup, rc);
- ctxt->loc_handle->lgh_logops->lop_add = llog_cat_add_rec;
- ctxt->loc_handle->lgh_logops->lop_declare_add =
- llog_cat_declare_add_rec;
-
rc = llog_cat_init_and_process(env, ctxt->loc_handle);
if (rc)
GOTO(out_close, rc);
rc = llog_cat_init_and_process(env, ctxt->loc_handle);
if (rc)
GOTO(out_close, 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;
+
llo_local_obj_register(&llod_capa_key);
llo_local_obj_register(&llod_mdd_orphan);
llo_local_obj_register(&llod_mdd_root);
llo_local_obj_register(&llod_capa_key);
llo_local_obj_register(&llod_mdd_orphan);
llo_local_obj_register(&llod_mdd_root);
#include <obd_class.h>
#include <lustre_param.h>
#include <obd_class.h>
#include <lustre_param.h>
#include "osp_internal.h"
#include "osp_internal.h"
.o_statfs = osp_obd_statfs,
};
.o_statfs = osp_obd_statfs,
};
+struct llog_operations osp_mds_ost_orig_logops;
+
static int __init osp_mod_init(void)
{
struct lprocfs_static_vars lvars;
static int __init osp_mod_init(void)
{
struct lprocfs_static_vars lvars;
+ /* 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;
+
osc_proc_dir = lprocfs_srch(proc_lustre_root, "osc");
if (osc_proc_dir == NULL) {
osc_proc_dir = lprocfs_register("osc", proc_lustre_root, NULL,
osc_proc_dir = lprocfs_srch(proc_lustre_root, "osc");
if (osc_proc_dir == NULL) {
osc_proc_dir = lprocfs_register("osc", proc_lustre_root, NULL,
/* osp_dev.c */
void osp_update_last_id(struct osp_device *d, obd_id objid);
/* osp_dev.c */
void osp_update_last_id(struct osp_device *d, obd_id objid);
+extern struct llog_operations osp_mds_ost_orig_logops;
/* osp_precreate.c */
int osp_init_precreate(struct osp_device *d);
/* osp_precreate.c */
int osp_init_precreate(struct osp_device *d);
-static struct llog_operations osp_mds_ost_orig_logops;
-
static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
{
struct osp_thread_info *osi = osp_env_info(env);
static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
{
struct osp_thread_info *osi = osp_env_info(env);
osi->osi_cid.lci_logid.lgl_oseq,
osi->osi_cid.lci_logid.lgl_ogen);
osi->osi_cid.lci_logid.lgl_oseq,
osi->osi_cid.lci_logid.lgl_ogen);
- osp_mds_ost_orig_logops = llog_osd_ops;
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, obd,
&osp_mds_ost_orig_logops);
if (rc)
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, obd,
&osp_mds_ost_orig_logops);
if (rc)
}
ctxt->loc_handle = lgh;
}
ctxt->loc_handle = lgh;
- lgh->lgh_logops->lop_add = llog_cat_add_rec;
- lgh->lgh_logops->lop_declare_add = llog_cat_declare_add_rec;
rc = llog_cat_init_and_process(env, lgh);
if (rc)
rc = llog_cat_init_and_process(env, lgh);
if (rc)