diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-03-09 20:55:56 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-26 17:42:39 -0400 |
commit | a3d3329159ea76bae0b3b8680691a1c3ecf5801f (patch) | |
tree | a4521103c45190ff340f918d131649a20b414b27 /fs/ocfs2/dlm/dlmrecovery.c | |
parent | 65c491d833a06fd0d1383297590772c75d28155c (diff) |
ocfs2: calculate lockid hash values outside of the spinlock
Fixes a performance bug - pointed out by Andrew.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmrecovery.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmrecovery.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 9962190e7416..4f3d482a7299 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c | |||
@@ -1404,6 +1404,7 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data) | |||
1404 | struct dlm_ctxt *dlm = data; | 1404 | struct dlm_ctxt *dlm = data; |
1405 | struct dlm_master_requery *req = (struct dlm_master_requery *)msg->buf; | 1405 | struct dlm_master_requery *req = (struct dlm_master_requery *)msg->buf; |
1406 | struct dlm_lock_resource *res = NULL; | 1406 | struct dlm_lock_resource *res = NULL; |
1407 | unsigned int hash; | ||
1407 | int master = DLM_LOCK_RES_OWNER_UNKNOWN; | 1408 | int master = DLM_LOCK_RES_OWNER_UNKNOWN; |
1408 | u32 flags = DLM_ASSERT_MASTER_REQUERY; | 1409 | u32 flags = DLM_ASSERT_MASTER_REQUERY; |
1409 | 1410 | ||
@@ -1413,8 +1414,10 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data) | |||
1413 | return master; | 1414 | return master; |
1414 | } | 1415 | } |
1415 | 1416 | ||
1417 | hash = dlm_lockid_hash(req->name, req->namelen); | ||
1418 | |||
1416 | spin_lock(&dlm->spinlock); | 1419 | spin_lock(&dlm->spinlock); |
1417 | res = __dlm_lookup_lockres(dlm, req->name, req->namelen); | 1420 | res = __dlm_lookup_lockres(dlm, req->name, req->namelen, hash); |
1418 | if (res) { | 1421 | if (res) { |
1419 | spin_lock(&res->spinlock); | 1422 | spin_lock(&res->spinlock); |
1420 | master = res->owner; | 1423 | master = res->owner; |