|
34 | 34 | #include <linux/kernel.h> |
35 | 35 | #include <linux/jhash.h> |
36 | 36 | #include <linux/miscdevice.h> |
| 37 | +#include <linux/rhashtable.h> |
37 | 38 | #include <linux/mutex.h> |
38 | 39 | #include <linux/idr.h> |
39 | 40 | #include <linux/ratelimit.h> |
@@ -99,15 +100,6 @@ do { \ |
99 | 100 | } \ |
100 | 101 | } |
101 | 102 |
|
102 | | - |
103 | | -#define DLM_RTF_SHRINK_BIT 0 |
104 | | - |
105 | | -struct dlm_rsbtable { |
106 | | - struct rb_root r; |
107 | | - unsigned long flags; |
108 | | -}; |
109 | | - |
110 | | - |
111 | 103 | /* |
112 | 104 | * Lockspace member (per node in a ls) |
113 | 105 | */ |
@@ -327,13 +319,12 @@ struct dlm_rsb { |
327 | 319 | int res_id; /* for ls_recover_idr */ |
328 | 320 | uint32_t res_lvbseq; |
329 | 321 | uint32_t res_hash; |
330 | | - uint32_t res_bucket; /* rsbtbl */ |
331 | 322 | unsigned long res_toss_time; |
332 | 323 | uint32_t res_first_lkid; |
333 | 324 | struct list_head res_lookup; /* lkbs waiting on first */ |
334 | 325 | union { |
335 | 326 | struct list_head res_hashchain; |
336 | | - struct rb_node res_hashnode; /* rsbtbl */ |
| 327 | + struct rhash_head res_node; /* rsbtbl */ |
337 | 328 | }; |
338 | 329 | struct list_head res_grantqueue; |
339 | 330 | struct list_head res_convertqueue; |
@@ -592,9 +583,10 @@ struct dlm_ls { |
592 | 583 | struct idr ls_lkbidr; |
593 | 584 | spinlock_t ls_lkbidr_spin; |
594 | 585 |
|
595 | | - struct dlm_rsbtable *ls_rsbtbl; |
| 586 | + struct rhashtable ls_rsbtbl; |
| 587 | +#define DLM_RTF_SHRINK_BIT 0 |
| 588 | + unsigned long ls_rsbtbl_flags; |
596 | 589 | spinlock_t ls_rsbtbl_lock; |
597 | | - uint32_t ls_rsbtbl_size; |
598 | 590 |
|
599 | 591 | struct list_head ls_toss; |
600 | 592 | struct list_head ls_keep; |
|
0 commit comments