Whamcloud - gitweb
- cleanups in mdt_object_set_mode()
authoryury <yury>
Thu, 26 Oct 2006 14:51:51 +0000 (14:51 +0000)
committeryury <yury>
Thu, 26 Oct 2006 14:51:51 +0000 (14:51 +0000)
lustre/mdt/mdt_handler.c

index ca13f39..fa75454 100644 (file)
@@ -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;