From 39791d4bcb0f7a8919d71ca90681317eaa93057e Mon Sep 17 00:00:00 2001 From: tappro Date: Thu, 19 Oct 2006 00:52:46 +0000 Subject: [PATCH] - enable check for correct placement in split dir - lmv_intent_open() uses lmv_get_export() --- lustre/cmm/cmm_object.c | 3 +-- lustre/cmm/cmm_split.c | 6 ++---- lustre/lmv/lmv_intent.c | 22 ++++++++-------------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index ec49af8..f029449 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -361,8 +361,7 @@ static int cml_lookup(const struct lu_env *env, struct md_object *mo_p, { int rc; ENTRY; -#if 0 - //#ifdef HAVE_SPLIT_SUPPORT +#ifdef HAVE_SPLIT_SUPPORT rc = cmm_mdsnum_check(env, mo_p, name); if (rc) RETURN(rc); diff --git a/lustre/cmm/cmm_split.c b/lustre/cmm/cmm_split.c index c78c367..b6e287a 100644 --- a/lustre/cmm/cmm_split.c +++ b/lustre/cmm/cmm_split.c @@ -73,7 +73,6 @@ int cmm_mdsnum_check(const struct lu_env *env, struct md_object *mp, RETURN(rc); if (ma->ma_valid & MA_LMV) { - struct lu_buf *buf; int stripe; OBD_ALLOC(ma->ma_lmv, ma->ma_lmv_size); @@ -81,9 +80,8 @@ int cmm_mdsnum_check(const struct lu_env *env, struct md_object *mp, RETURN(-ENOMEM); /* get LMV EA */ - buf = cmm_buf_get(env, ma->ma_lmv, ma->ma_lmv_size); - rc = mo_xattr_get(env, md_object_next(mp), buf, - MDS_LMV_MD_NAME); + ma->ma_need = MA_INODE | MA_LMV; + rc = mo_attr_get(env, mp, ma); if (rc) RETURN(rc); diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index 47cbd7c..16f768f 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -186,6 +186,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data, int extra_lock_flags) { struct obd_device *obd = exp->exp_obd; + struct obd_export *tgt_exp; struct lu_fid rpid = op_data->fid1; struct lmv_obd *lmv = &obd->u.lmv; struct mdt_body *body = NULL; @@ -193,7 +194,6 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data, struct lmv_stripe_md *mea; struct lmv_obj *obj; int rc, loop = 0; - mdsno_t mds; ENTRY; OBD_ALLOC_PTR(sop_data); @@ -205,10 +205,6 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data, repeat: LASSERT(++loop <= 2); - rc = lmv_fld_lookup(lmv, &rpid, &mds); - if (rc) - GOTO(out_free_sop_data, rc); - obj = lmv_obj_grab(obd, &rpid); if (obj) { int mea_idx; @@ -221,20 +217,18 @@ repeat: op_data->namelen); rpid = obj->lo_inodes[mea_idx].li_fid; - rc = lmv_fld_lookup(lmv, &rpid, &mds); lmv_obj_put(obj); - if (rc) - GOTO(out_free_sop_data, rc); - - CDEBUG(D_OTHER, "forward to MDS #"LPU64" ("DFID")\n", - mds, PFID(&rpid)); + CDEBUG(D_OTHER, "Choose slave dir ("DFID")\n", PFID(&rpid)); } + tgt_exp = lmv_get_export(lmv, &rpid); + if (IS_ERR(tgt_exp)) + GOTO(out_free_sop_data, rc = PTR_ERR(tgt_exp)); + sop_data->fid1 = rpid; - rc = md_intent_lock(lmv->tgts[mds].ltd_exp, sop_data, - lmm, lmmsize, it, flags, reqp, - cb_blocking, extra_lock_flags); + rc = md_intent_lock(tgt_exp, sop_data, lmm, lmmsize, it, flags, + reqp, cb_blocking, extra_lock_flags); if (rc == -ERESTART) { /* -- 1.8.3.1