From bcb334a2de78a975599d5f5a5959d9e8f096f4d8 Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 26 Oct 2006 14:51:51 +0000 Subject: [PATCH] - cleanups in mdt_object_set_mode() --- lustre/mdt/mdt_handler.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; -- 1.8.3.1