From: yury Date: Thu, 26 Oct 2006 14:51:51 +0000 (+0000) Subject: - cleanups in mdt_object_set_mode() X-Git-Tag: v1_8_0_110~486^2~332 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=bcb334a2de78a975599d5f5a5959d9e8f096f4d8;p=fs%2Flustre-release.git - cleanups in mdt_object_set_mode() --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index ca13f39..fa75454 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1553,18 +1553,22 @@ struct mdt_object *mdt_object_find(const struct lu_env *env, } /* XXX: This is for debug only. */ -static void mdt_object_set_mode(struct mdt_object *o, - struct mdt_lock_handle *lh) +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 = mdt_dlm_mode2mdl_mode(lh->mlh_pdo_mode); + 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 = mdt_dlm_mode2mdl_mode(lh->mlh_reg_mode); + o->mot_obj.mo_reg_mode = reg_mode; else o->mot_obj.mo_reg_mode = MDL_MINMODE;