From: yury Date: Sun, 29 Oct 2006 14:56:53 +0000 (+0000) Subject: - removed debug stuff. X-Git-Tag: v1_8_0_110~486^2~310 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=787c9df1866c19320b072991890034b5e5112d6d;p=fs%2Flustre-release.git - removed debug stuff. --- diff --git a/lustre/cmm/cmm_split.c b/lustre/cmm/cmm_split.c index 6f344d5..3ba61b0 100644 --- a/lustre/cmm/cmm_split.c +++ b/lustre/cmm/cmm_split.c @@ -476,17 +476,15 @@ int cmm_try_to_split(const struct lu_env *env, struct md_object *mo) LASSERT(S_ISDIR(lu_object_attr(&mo->mo_lu))); memset(ma, 0, sizeof(*ma)); + /* Step1: Checking whether the dir needs to be split. */ rc = cmm_expect_splitting(env, mo, ma, &split); if (rc) RETURN(rc); + if (split != CMM_EXPECT_SPLIT) RETURN(0); - LASSERTF(mo->mo_pdo_mode == MDL_EX, "Split is only valid if " - "dir is protected by MDL_EX lock. Lock mode 0x%x\n", - (int)mo->mo_pdo_mode); - /* * Disable trans for splitting, since there will be so many trans in * this one ops, confilct with current recovery design. @@ -497,7 +495,7 @@ int cmm_try_to_split(const struct lu_env *env, struct md_object *mo) GOTO(cleanup, rc); } - /* step2: Prepare the md memory */ + /* Step2: Prepare the md memory */ ma->ma_lmv_size = CMM_MD_SIZE(cmm->cmm_tgt_count + 1); OBD_ALLOC(ma->ma_lmv, ma->ma_lmv_size); if (ma->ma_lmv == NULL) @@ -530,9 +528,10 @@ int cmm_try_to_split(const struct lu_env *env, struct md_object *mo) /* Finally, split succeed, tell client to recreate the object */ CWARN("Dir "DFID" has been split\n", PFID(lu_object_fid(&mo->mo_lu))); rc = -ERESTART; + EXIT; cleanup: OBD_FREE(ma->ma_lmv, ma->ma_lmv_size); - RETURN(rc); + return rc; } int cmm_mdsnum_check(const struct lu_env *env, struct md_object *mp, diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index 93318e2..183096f 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -298,14 +298,6 @@ struct md_object { struct lu_object mo_lu; struct md_object_operations *mo_ops; struct md_dir_operations *mo_dir_ops; - - /* - * XXX: This is for debug only, to check on all layers lock mode on the - * object. This is useful say for split. Split should be protected by EX - * lock and this should be checked in cmm split code. - */ - mdl_mode_t mo_reg_mode; - mdl_mode_t mo_pdo_mode; }; static inline int lu_device_is_md(const struct lu_device *d) diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index e88aa93..9bb5a07 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -801,7 +801,7 @@ static int lmv_placement_policy(struct obd_device *obd, *mds = 0; rc = -ENOSYS; } -exit: + if (rc) { CERROR("Can't choose MDS, err = %d\n", rc); } else { diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 047d2f7..30de234 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1550,30 +1550,6 @@ struct mdt_object *mdt_object_find(const struct lu_env *env, RETURN(m); } -/* XXX: This is for debug only. */ -static inline void mdt_object_set_mode(struct mdt_object *o, - struct mdt_lock_handle *lh) -{ - struct md_object *n = mdt_object_child(o); - mdl_mode_t reg_mode, pdo_mode; - - pdo_mode = mdt_dlm_mode2mdl_mode(lh->mlh_pdo_mode); - reg_mode = mdt_dlm_mode2mdl_mode(lh->mlh_reg_mode); - - if (lh->mlh_pdo_lh.cookie != 0) - o->mot_obj.mo_pdo_mode = pdo_mode; - else - o->mot_obj.mo_pdo_mode = MDL_MINMODE; - - if (lh->mlh_reg_lh.cookie != 0) - o->mot_obj.mo_reg_mode = reg_mode; - else - o->mot_obj.mo_reg_mode = MDL_MINMODE; - - n->mo_pdo_mode = o->mot_obj.mo_pdo_mode; - n->mo_reg_mode = o->mot_obj.mo_reg_mode; -} - int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o, struct mdt_lock_handle *lh, __u64 ibits, int locality) { @@ -1652,9 +1628,6 @@ int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o, mdt_fid_unlock(&lh->mlh_pdo_lh, lh->mlh_pdo_mode); lh->mlh_pdo_lh.cookie = 0ull; } - - if (rc == 0) - mdt_object_set_mode(o, lh); RETURN(rc); } @@ -1688,8 +1661,6 @@ void mdt_object_unlock(struct mdt_thread_info *info, struct mdt_object *o, lh->mlh_reg_lh.cookie = 0; } - mdt_object_set_mode(o, lh); - EXIT; }