Skip to content

Commit 37a247d

Browse files
Alexander Aringteigland
authored andcommitted
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>
1 parent 2874d1a commit 37a247d

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

fs/dlm/lowcomms.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#include "config.h"
6060

6161
#define NEEDED_RMEM (4*1024*1024)
62-
#define CONN_HASH_SIZE 32
6362

6463
/* Number of messages to send before rescheduling */
6564
#define MAX_SEND_MSG_COUNT 25
@@ -175,14 +174,6 @@ static void sctp_connect_to_sock(struct connection *con);
175174
static void tcp_connect_to_sock(struct connection *con);
176175
static void dlm_tcp_shutdown(struct connection *con);
177176

178-
/* This is deliberately very simple because most clusters have simple
179-
sequential nodeids, so we should be able to go straight to a connection
180-
struct in the array */
181-
static inline int nodeid_hash(int nodeid)
182-
{
183-
return nodeid & (CONN_HASH_SIZE-1);
184-
}
185-
186177
static struct connection *__find_con(int nodeid, int r)
187178
{
188179
struct connection *con;

fs/dlm/lowcomms.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
#define __LOWCOMMS_DOT_H__
1414

1515
#define LOWCOMMS_MAX_TX_BUFFER_LEN 4096
16+
#define CONN_HASH_SIZE 32
17+
18+
/* This is deliberately very simple because most clusters have simple
19+
* sequential nodeids, so we should be able to go straight to a connection
20+
* struct in the array
21+
*/
22+
static inline int nodeid_hash(int nodeid)
23+
{
24+
return nodeid & (CONN_HASH_SIZE-1);
25+
}
1626

1727
/* switch to check if dlm is running */
1828
extern int dlm_allow_conn;

0 commit comments

Comments
 (0)