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>
This commit is contained in:
committed by
David Teigland
parent
2874d1a68c
commit
37a247da51
@@ -59,7 +59,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define NEEDED_RMEM (4*1024*1024)
|
#define NEEDED_RMEM (4*1024*1024)
|
||||||
#define CONN_HASH_SIZE 32
|
|
||||||
|
|
||||||
/* Number of messages to send before rescheduling */
|
/* Number of messages to send before rescheduling */
|
||||||
#define MAX_SEND_MSG_COUNT 25
|
#define MAX_SEND_MSG_COUNT 25
|
||||||
@@ -175,14 +174,6 @@ static void sctp_connect_to_sock(struct connection *con);
|
|||||||
static void tcp_connect_to_sock(struct connection *con);
|
static void tcp_connect_to_sock(struct connection *con);
|
||||||
static void dlm_tcp_shutdown(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)
|
static struct connection *__find_con(int nodeid, int r)
|
||||||
{
|
{
|
||||||
struct connection *con;
|
struct connection *con;
|
||||||
|
|||||||
@@ -13,6 +13,16 @@
|
|||||||
#define __LOWCOMMS_DOT_H__
|
#define __LOWCOMMS_DOT_H__
|
||||||
|
|
||||||
#define LOWCOMMS_MAX_TX_BUFFER_LEN 4096
|
#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 */
|
/* switch to check if dlm is running */
|
||||||
extern int dlm_allow_conn;
|
extern int dlm_allow_conn;
|
||||||
|
|||||||
Reference in New Issue
Block a user