Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=019d1b2247c6898589560c6f3b3e7ec280b0010a
Commit:     019d1b2247c6898589560c6f3b3e7ec280b0010a
Parent:     3cf0c507dd28de0e1a4c24304d806e6b3976f0f5
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 5 12:09:05 2007 -0700
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Tue Nov 6 15:31:45 2007 -0800

    ocfs2: Create locks at initially requested level
    
    If we have not yet created a cluster lock, ocfs2_cluster_lock() will
    first create it at NLMODE, and then convert the lock to either PRMODE or
    EXMODE (whichever is requested).
    
    Change ocfs2_cluster_lock() to just create the lock at the initially
    requested level. ocfs2_locking_ast() handles this case fine, so the only
    update required was in setup of locking state. This should reduce the number
    of network messages required for a new lock by one, providing an incremental
    performance enhancement.
    
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/dlmglue.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index ef09fd2..4e97dcc 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -980,18 +980,6 @@ again:
                goto unlock;
        }
 
-       if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
-               /* lock has not been created yet. */
-               spin_unlock_irqrestore(&lockres->l_lock, flags);
-
-               ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       goto out;
-               }
-               goto again;
-       }
-
        if (lockres->l_flags & OCFS2_LOCK_BLOCKED &&
            !ocfs2_may_continue_on_blocked_lock(lockres, level)) {
                /* is the lock is currently blocked on behalf of
@@ -1006,7 +994,14 @@ again:
                        mlog(ML_ERROR, "lockres %s has action %u pending\n",
                             lockres->l_name, lockres->l_action);
 
-               lockres->l_action = OCFS2_AST_CONVERT;
+               if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) {
+                       lockres->l_action = OCFS2_AST_ATTACH;
+                       lkm_flags &= ~LKM_CONVERT;
+               } else {
+                       lockres->l_action = OCFS2_AST_CONVERT;
+                       lkm_flags |= LKM_CONVERT;
+               }
+
                lockres->l_requested = level;
                lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
                spin_unlock_irqrestore(&lockres->l_lock, flags);
@@ -1021,7 +1016,7 @@ again:
                status = dlmlock(osb->dlm,
                                 level,
                                 &lockres->l_lksb,
-                                lkm_flags|LKM_CONVERT,
+                                lkm_flags,
                                 lockres->l_name,
                                 OCFS2_LOCK_ID_MAX_LEN - 1,
                                 ocfs2_locking_ast,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to