ocfs2/dlm: dlm_set_lockres_owner() and dlm_change_lockres_owner() inlined
authorSunil Mushran <sunil.mushran@oracle.com>
Thu, 26 Feb 2009 23:00:45 +0000 (15:00 -0800)
committerMark Fasheh <mfasheh@suse.com>
Fri, 3 Apr 2009 18:39:21 +0000 (11:39 -0700)
This patch inlines dlm_set_lockres_owner() and dlm_change_lockres_owner().

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmmaster.c

index e5026ce862addbc8f0e225c6d979cbb10b612f01..266fde9354bd32144bd2668fc4ba34490042b918 100644 (file)
@@ -858,9 +858,7 @@ struct dlm_lock_resource * dlm_lookup_lockres(struct dlm_ctxt *dlm,
                                              unsigned int len);
 
 int dlm_is_host_down(int errno);
-void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
-                             struct dlm_lock_resource *res,
-                             u8 owner);
+
 struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm,
                                                 const char *lockid,
                                                 int namelen,
@@ -1123,6 +1121,23 @@ static inline int dlm_node_iter_next(struct dlm_node_iter *iter)
        return bit;
 }
 
+static inline void dlm_set_lockres_owner(struct dlm_ctxt *dlm,
+                                        struct dlm_lock_resource *res,
+                                        u8 owner)
+{
+       assert_spin_locked(&res->spinlock);
+
+       res->owner = owner;
+}
 
+static inline void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
+                                           struct dlm_lock_resource *res,
+                                           u8 owner)
+{
+       assert_spin_locked(&res->spinlock);
+
+       if (owner != res->owner)
+               dlm_set_lockres_owner(dlm, res, owner);
+}
 
 #endif /* DLMCOMMON_H */
index d70cdd51de0ffa5d7ea25762a62616cb8dba4d00..d9c5c5a340078217d43c28da72c1c41a292531f6 100644 (file)
@@ -511,25 +511,6 @@ void dlm_destroy_master_caches(void)
                kmem_cache_destroy(dlm_lockres_cache);
 }
 
-static void dlm_set_lockres_owner(struct dlm_ctxt *dlm,
-                                 struct dlm_lock_resource *res,
-                                 u8 owner)
-{
-       assert_spin_locked(&res->spinlock);
-
-       res->owner = owner;
-}
-
-void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
-                             struct dlm_lock_resource *res, u8 owner)
-{
-       assert_spin_locked(&res->spinlock);
-
-       if (owner != res->owner)
-               dlm_set_lockres_owner(dlm, res, owner);
-}
-
-
 static void dlm_lockres_release(struct kref *kref)
 {
        struct dlm_lock_resource *res;