All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCHv4 dlm/next 5/8] fs: dlm: move out some hash functionality
Date: Fri,  9 Apr 2021 10:48:56 -0400	[thread overview]
Message-ID: <20210409144859.48385-6-aahringo@redhat.com> (raw)
In-Reply-To: <20210409144859.48385-1-aahringo@redhat.com>

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>
---
 fs/dlm/lowcomms.c |  9 ---------
 fs/dlm/lowcomms.h | 10 ++++++++++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index fb04448c4e48..0e08a59e489c 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -59,7 +59,6 @@
 #include "config.h"
 
 #define NEEDED_RMEM (4*1024*1024)
-#define CONN_HASH_SIZE 32
 
 /* Number of messages to send before rescheduling */
 #define MAX_SEND_MSG_COUNT 25
@@ -166,14 +165,6 @@ static void sctp_connect_to_sock(struct connection *con);
 static void tcp_connect_to_sock(struct connection *con);
 static void dlm_tcp_shutdown(struct connection *con);
 
-/* 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);
-}
-
 static struct connection *__find_con(int nodeid)
 {
 	int r, idx;
diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h
index 345aed7e00cc..cacfc5620f54 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;
-- 
2.26.3



  parent reply	other threads:[~2021-04-09 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 14:48 [Cluster-devel] [PATCHv4 dlm/next 0/8] fs: dlm: introduce dlm re-transmission layer Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 1/8] fs: dlm: public header in out utility Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 2/8] fs: dlm: add more midcomms hooks Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 3/8] fs: dlm: make buffer handling per msg Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 4/8] fs: dlm: add functionality to re-transmit a message Alexander Aring
2021-04-21 14:45   ` Alexander Ahring Oder Aring
2021-04-22 21:11   ` Alexander Ahring Oder Aring
2021-04-09 14:48 ` Alexander Aring [this message]
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 6/8] fs: dlm: add union in dlm header for lockspace id Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 7/8] fs: dlm: add reliable connection if reconnect Alexander Aring
2021-04-09 14:48 ` [Cluster-devel] [PATCHv4 dlm/next 8/8] fs: dlm: don't allow half transmitted messages Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210409144859.48385-6-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.