summaryrefslogtreecommitdiffstats
path: root/fs/dlm/lowcomms.h
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2021-05-21 21:08:44 +0200
committerDavid Teigland <teigland@redhat.com>2021-05-25 16:22:20 +0200
commit37a247da517f4315eed21585be8aa516e0b9cec9 (patch)
tree592c05c4799c4b2976743915f9989a1438808e19 /fs/dlm/lowcomms.h
parentfs: dlm: add functionality to re-transmit a message (diff)
downloadlinux-37a247da517f4315eed21585be8aa516e0b9cec9.tar.xz
linux-37a247da517f4315eed21585be8aa516e0b9cec9.zip
fs: dlm: move out some hash functionality
This patch moves out some lowcomms hash functionality into lowcomms header to provide them to other layers like midcomms as well. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lowcomms.h')
-rw-r--r--fs/dlm/lowcomms.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h
index a4384826442c..66dc1bb3de7f 100644
--- a/fs/dlm/lowcomms.h
+++ b/fs/dlm/lowcomms.h
@@ -13,6 +13,16 @@
#define __LOWCOMMS_DOT_H__
#define LOWCOMMS_MAX_TX_BUFFER_LEN 4096
+#define CONN_HASH_SIZE 32
+
+/* This is deliberately very simple because most clusters have simple
+ * sequential nodeids, so we should be able to go straight to a connection
+ * struct in the array
+ */
+static inline int nodeid_hash(int nodeid)
+{
+ return nodeid & (CONN_HASH_SIZE-1);
+}
/* switch to check if dlm is running */
extern int dlm_allow_conn;