summaryrefslogtreecommitdiffstats
path: root/fs/dlm/config.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-04-15 20:39:39 +0200
committerDavid Teigland <teigland@redhat.com>2024-04-16 21:34:39 +0200
commit6c648035cbe75d78836f6d7d2fdd9d996048a66b (patch)
treee062c9951814bb7f3fcac71332d1ac54ff383e06 /fs/dlm/config.c
parentdlm: add rsb lists for iteration (diff)
downloadlinux-6c648035cbe75d78836f6d7d2fdd9d996048a66b.tar.xz
linux-6c648035cbe75d78836f6d7d2fdd9d996048a66b.zip
dlm: switch to use rhashtable for rsbs
Replace our own hash table with the more advanced rhashtable for keeping rsb structs. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/config.c')
-rw-r--r--fs/dlm/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index e55e0a2cd2e8..517fa975dc5a 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -63,6 +63,14 @@ static void release_node(struct config_item *);
static struct configfs_attribute *comm_attrs[];
static struct configfs_attribute *node_attrs[];
+const struct rhashtable_params dlm_rhash_rsb_params = {
+ .nelem_hint = 3, /* start small */
+ .key_len = DLM_RESNAME_MAXLEN,
+ .key_offset = offsetof(struct dlm_rsb, res_name),
+ .head_offset = offsetof(struct dlm_rsb, res_node),
+ .automatic_shrinking = true,
+};
+
struct dlm_cluster {
struct config_group group;
unsigned int cl_tcp_port;