From: wangdi Date: Mon, 17 Jul 2006 09:49:56 +0000 (+0000) Subject: Branch: b_new_cmd X-Git-Tag: v1_8_0_110~486^2~1397 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=114a18cbbba20f4bcafa2ce90009ef70a4c4cd64;p=fs%2Flustre-release.git Branch: b_new_cmd remove md_lov_ctxt from md_lov_info, it is per_thread item --- diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index 561d93a..efc93aa 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -77,14 +77,15 @@ static int cmm_statfs(const struct lu_context *ctxt, struct md_device *md, RETURN (rc); } -int cmm_notify(struct md_device *md, struct obd_device *watched, +int cmm_notify(const struct lu_context *ctxt, struct md_device *md, + struct obd_device *watched, enum obd_notify_event ev, void *data) { struct cmm_device *cmm_dev = md2cmm_dev(md); int rc; - rc = cmm_child_ops(cmm_dev)->mdo_notify(cmm_dev->cmm_child, watched, - ev, data); + rc = cmm_child_ops(cmm_dev)->mdo_notify(ctxt, cmm_dev->cmm_child, + watched, ev, data); return rc; } diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index ddb1ac6..f221666 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -111,7 +111,8 @@ struct md_device_operations { /* * notify function for metadata stack */ - int (*mdo_notify)(struct md_device *m, struct obd_device *watched, + int (*mdo_notify)(const struct lu_context *ctx, + struct md_device *m, struct obd_device *watched, enum obd_notify_event ev, void *data); }; diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 1326bc3..71a5c72 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -427,7 +427,6 @@ struct md_lov_info { int md_lov_max_mdsize; int md_lov_max_cookiesize; struct semaphore md_lov_orphan_recovery_sem; - struct lu_context md_lov_ctxt; struct md_lov_ops *md_lov_ops; }; diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index 6be1f5a..1498ad3 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -55,8 +55,9 @@ struct mdd_thread_info { int mdd_lov_init(const struct lu_context *ctxt, struct mdd_device *mdd, struct lustre_cfg *cfg); int mdd_lov_fini(const struct lu_context *ctxt, struct mdd_device *mdd); -int mdd_notify(struct md_device *md, struct obd_device *watched, - enum obd_notify_event ev, void *data); +int mdd_notify(const struct lu_context *ctxt, struct md_device *md, + struct obd_device *watched, enum obd_notify_event ev, + void *data); int mdd_xattr_set(const struct lu_context *ctxt, struct md_object *obj, const void *buf, int buf_len, const char *name); diff --git a/lustre/mdd/mdd_lov.c b/lustre/mdd/mdd_lov.c index f37d8e0..85516aa 100644 --- a/lustre/mdd/mdd_lov.c +++ b/lustre/mdd/mdd_lov.c @@ -143,7 +143,6 @@ int mdd_lov_fini(const struct lu_context *ctxt, struct mdd_device *mdd) mli->md_lov_exp = NULL; } - lu_context_fini(&mli->md_lov_ctxt); dt_object_fini(mli->md_lov_objid_obj); return 0; } @@ -180,12 +179,11 @@ int mdd_lov_init(const struct lu_context *ctxt, struct mdd_device *mdd, CERROR("No such OBD %s\n", srv); LBUG(); } - rc = md_lov_connect(obd, lov_info, lov_name, + CDEBUG(D_INFO, "srv name %s, obd %p \n", obd->obd_name, obd); + rc = md_lov_connect(obd, lov_info, lov_name, &obd->obd_uuid, &mdd_lov_ops, ctxt); if (rc) GOTO(out, rc); - - rc = lu_context_init(&lov_info->md_lov_ctxt); out: if (rc) mdd_lov_fini(ctxt, mdd); @@ -193,7 +191,8 @@ out: RETURN(rc); } -int mdd_notify(struct md_device *md, struct obd_device *watched, +int mdd_notify(const struct lu_context *ctxt, struct md_device *md, + struct obd_device *watched, enum obd_notify_event ev, void *data) { struct mdd_device *mdd = lu2mdd_dev(&md->md_lu_dev); @@ -208,11 +207,8 @@ int mdd_notify(struct md_device *md, struct obd_device *watched, RETURN(rc); } - lu_context_enter(&mdd->mdd_lov_info.md_lov_ctxt); rc = md_lov_start_synchronize(obd, &mdd->mdd_lov_info, watched, data, - !(ev == OBD_NOTIFY_SYNC), - &mdd->mdd_lov_info.md_lov_ctxt); - lu_context_exit(&mdd->mdd_lov_info.md_lov_ctxt); + !(ev == OBD_NOTIFY_SYNC), ctxt); RETURN(rc); } diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 451b952..78464de 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -364,6 +364,8 @@ int md_lov_connect(struct obd_device *obd, struct md_lov_info *mli, lov_name, rc); GOTO(out, rc); } + CDEBUG(D_INFO, "regist observer %s to lov %s \n", + obd->obd_name, mli->md_lov_obd->obd_name); rc = mli->md_lov_ops->ml_read_objids(obd, mli, ctxt); if (rc) { diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index c84e853..0295be7 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2553,14 +2553,20 @@ static int mdt_notify(struct obd_device *obd, struct obd_device *watched, { struct mdt_device *mdt; struct md_device *next; + struct lu_context ctxt; int rc; ENTRY; + lu_context_init(&ctxt); + mdt = mdt_dev(obd->obd_lu_dev); next = mdt->mdt_child; - - rc = next->md_ops->mdo_notify(next, watched, ev, data); - + + lu_context_enter(&ctxt); + rc = next->md_ops->mdo_notify(&ctxt, next, watched, ev, data); + lu_context_exit(&ctxt); + + lu_context_fini(&ctxt); RETURN(rc); } @@ -2570,7 +2576,7 @@ static struct obd_ops mdt_obd_device_ops = { .o_disconnect = mdt_obd_disconnect, .o_init_export = mdt_init_export, /* By Huang Hua*/ .o_destroy_export = mdt_destroy_export, /* By Huang Hua*/ - //.o_notify = mdt_notify, + .o_notify = mdt_notify, }; static void mdt_device_free(const struct lu_context *ctx, struct lu_device *d)