aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmcommon.h
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-02-28 20:31:22 -0500
committerMark Fasheh <mark.fasheh@oracle.com>2006-03-01 15:18:16 -0500
commit81f2094a631df1ba275f4d4bd7ea5bacfd8dbcfc (patch)
tree20efc0b486ec9cb260d22dd09f02de13c0e71eb1 /fs/ocfs2/dlm/dlmcommon.h
parentb7668c72d2ae004363fb0588600bfa942e1b245c (diff)
[PATCH] ocfs2: use hlists for lockres hash
Switch from list_head to hlist_head. Make the size of the hash dependent upon the allocated area, rather than a constant. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmcommon.h')
-rw-r--r--fs/ocfs2/dlm/dlmcommon.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index 23ceaa7127b4..9c772583744a 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -37,9 +37,7 @@
37#define DLM_THREAD_SHUFFLE_INTERVAL 5 // flush everything every 5 passes 37#define DLM_THREAD_SHUFFLE_INTERVAL 5 // flush everything every 5 passes
38#define DLM_THREAD_MS 200 // flush at least every 200 ms 38#define DLM_THREAD_MS 200 // flush at least every 200 ms
39 39
40#define DLM_HASH_BITS 7 40#define DLM_HASH_BUCKETS (PAGE_SIZE / sizeof(struct hlist_head))
41#define DLM_HASH_SIZE (1 << DLM_HASH_BITS)
42#define DLM_HASH_MASK (DLM_HASH_SIZE - 1)
43 41
44enum dlm_ast_type { 42enum dlm_ast_type {
45 DLM_AST = 0, 43 DLM_AST = 0,
@@ -87,7 +85,7 @@ enum dlm_ctxt_state {
87struct dlm_ctxt 85struct dlm_ctxt
88{ 86{
89 struct list_head list; 87 struct list_head list;
90 struct list_head *resources; 88 struct hlist_head *lockres_hash;
91 struct list_head dirty_list; 89 struct list_head dirty_list;
92 struct list_head purge_list; 90 struct list_head purge_list;
93 struct list_head pending_asts; 91 struct list_head pending_asts;
@@ -217,7 +215,7 @@ struct dlm_lock_resource
217{ 215{
218 /* WARNING: Please see the comment in dlm_init_lockres before 216 /* WARNING: Please see the comment in dlm_init_lockres before
219 * adding fields here. */ 217 * adding fields here. */
220 struct list_head list; 218 struct hlist_node hash_node;
221 struct kref refs; 219 struct kref refs;
222 220
223 /* please keep these next 3 in this order 221 /* please keep these next 3 in this order