diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-02-26 18:00:40 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-04-03 14:39:18 -0400 |
commit | e2b66ddcce922529e058cf74d839c4c49c8379a1 (patch) | |
tree | d27e078e59c79624a2f7a1317c50934e543489f1 /fs/ocfs2/dlm/dlmcommon.h | |
parent | c2cd4a44333034203cb198915e2b75c3227d41bf (diff) |
ocfs2/dlm: Create and destroy the dlm->master_hash
This patch adds code to create and destroy the dlm->master_hash.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmcommon.h')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index b232aa0b3345..425653f88e98 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h | |||
@@ -151,6 +151,7 @@ struct dlm_ctxt | |||
151 | unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; | 151 | unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; |
152 | struct dlm_recovery_ctxt reco; | 152 | struct dlm_recovery_ctxt reco; |
153 | spinlock_t master_lock; | 153 | spinlock_t master_lock; |
154 | struct hlist_head **master_hash; | ||
154 | struct list_head master_list; | 155 | struct list_head master_list; |
155 | struct list_head mle_hb_events; | 156 | struct list_head mle_hb_events; |
156 | 157 | ||
@@ -195,6 +196,13 @@ static inline struct hlist_head *dlm_lockres_hash(struct dlm_ctxt *dlm, unsigned | |||
195 | return dlm->lockres_hash[(i / DLM_BUCKETS_PER_PAGE) % DLM_HASH_PAGES] + (i % DLM_BUCKETS_PER_PAGE); | 196 | return dlm->lockres_hash[(i / DLM_BUCKETS_PER_PAGE) % DLM_HASH_PAGES] + (i % DLM_BUCKETS_PER_PAGE); |
196 | } | 197 | } |
197 | 198 | ||
199 | static inline struct hlist_head *dlm_master_hash(struct dlm_ctxt *dlm, | ||
200 | unsigned i) | ||
201 | { | ||
202 | return dlm->master_hash[(i / DLM_BUCKETS_PER_PAGE) % DLM_HASH_PAGES] + | ||
203 | (i % DLM_BUCKETS_PER_PAGE); | ||
204 | } | ||
205 | |||
198 | /* these keventd work queue items are for less-frequently | 206 | /* these keventd work queue items are for less-frequently |
199 | * called functions that cannot be directly called from the | 207 | * called functions that cannot be directly called from the |
200 | * net message handlers for some reason, usually because | 208 | * net message handlers for some reason, usually because |