ocfs2: inline dlm_lockres_get()
authorMark Fasheh <mark.fasheh@oracle.com>
Fri, 10 Mar 2006 21:44:00 +0000 (13:44 -0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Mon, 26 Jun 2006 21:42:41 +0000 (14:42 -0700)
It's called on every lookup so this might help performance a bit.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmmaster.c

index 3b675368762e0f0929a94273b33dbcf924584ea2..87612819c13b180479ac7f78a23d654c477456ad 100644 (file)
@@ -690,7 +690,12 @@ void dlm_lockres_calc_usage(struct dlm_ctxt *dlm,
                            struct dlm_lock_resource *res);
 void dlm_purge_lockres(struct dlm_ctxt *dlm,
                       struct dlm_lock_resource *lockres);
-void dlm_lockres_get(struct dlm_lock_resource *res);
+static inline void dlm_lockres_get(struct dlm_lock_resource *res)
+{
+       /* This is called on every lookup, so it might be worth
+        * inlining. */
+       kref_get(&res->refs);
+}
 void dlm_lockres_put(struct dlm_lock_resource *res);
 void __dlm_unhash_lockres(struct dlm_lock_resource *res);
 void __dlm_insert_lockres(struct dlm_ctxt *dlm,
index 953aa8421be4acf28bc9f8816b838ac24ca4cf0c..f1fbf2f4e5d6e81e450bec2eb537f98ca518c501 100644 (file)
@@ -579,11 +579,6 @@ static void dlm_lockres_release(struct kref *kref)
        kfree(res);
 }
 
-void dlm_lockres_get(struct dlm_lock_resource *res)
-{
-       kref_get(&res->refs);
-}
-
 void dlm_lockres_put(struct dlm_lock_resource *res)
 {
        kref_put(&res->refs, dlm_lockres_release);