2019-05-29 00:57:20 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2006-01-18 17:30:29 +08:00
|
|
|
/******************************************************************************
|
|
|
|
*******************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
2009-05-07 23:54:16 +08:00
|
|
|
** Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
|
2006-01-18 17:30:29 +08:00
|
|
|
**
|
|
|
|
**
|
|
|
|
*******************************************************************************
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __LOWCOMMS_DOT_H__
|
|
|
|
#define __LOWCOMMS_DOT_H__
|
|
|
|
|
2021-05-22 03:08:46 +08:00
|
|
|
#include "dlm_internal.h"
|
|
|
|
|
|
|
|
#define DLM_MIDCOMMS_OPT_LEN sizeof(struct dlm_opts)
|
2021-06-02 21:45:20 +08:00
|
|
|
#define DLM_MAX_APP_BUFSIZE (DLM_MAX_SOCKET_BUFSIZE - \
|
2021-05-22 03:08:46 +08:00
|
|
|
DLM_MIDCOMMS_OPT_LEN)
|
|
|
|
|
2021-05-22 03:08:44 +08:00
|
|
|
#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);
|
|
|
|
}
|
2020-11-03 09:04:17 +08:00
|
|
|
|
2022-11-18 06:11:49 +08:00
|
|
|
/* check if dlm is running */
|
|
|
|
bool dlm_lowcomms_is_running(void);
|
2021-03-02 06:05:13 +08:00
|
|
|
|
2006-01-18 17:30:29 +08:00
|
|
|
int dlm_lowcomms_start(void);
|
2021-03-02 06:05:20 +08:00
|
|
|
void dlm_lowcomms_shutdown(void);
|
2022-11-18 06:11:50 +08:00
|
|
|
void dlm_lowcomms_shutdown_node(int nodeid, bool force);
|
2006-01-18 17:30:29 +08:00
|
|
|
void dlm_lowcomms_stop(void);
|
2022-11-18 06:11:46 +08:00
|
|
|
void dlm_lowcomms_init(void);
|
2012-07-27 01:44:30 +08:00
|
|
|
void dlm_lowcomms_exit(void);
|
2006-04-28 22:50:41 +08:00
|
|
|
int dlm_lowcomms_close(int nodeid);
|
2021-05-22 03:08:42 +08:00
|
|
|
struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation,
|
2021-11-03 03:17:19 +08:00
|
|
|
char **ppc, void (*cb)(void *data),
|
|
|
|
void *data);
|
2021-05-22 03:08:42 +08:00
|
|
|
void dlm_lowcomms_commit_msg(struct dlm_msg *msg);
|
|
|
|
void dlm_lowcomms_put_msg(struct dlm_msg *msg);
|
2021-05-22 03:08:43 +08:00
|
|
|
int dlm_lowcomms_resend_msg(struct dlm_msg *msg);
|
2009-05-07 23:54:16 +08:00
|
|
|
int dlm_lowcomms_connect_node(int nodeid);
|
2021-03-02 06:05:09 +08:00
|
|
|
int dlm_lowcomms_nodes_set_mark(int nodeid, unsigned int mark);
|
2012-07-27 01:44:30 +08:00
|
|
|
int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr, int len);
|
2021-08-19 04:27:13 +08:00
|
|
|
void dlm_midcomms_receive_done(int nodeid);
|
2021-12-01 03:47:19 +08:00
|
|
|
struct kmem_cache *dlm_lowcomms_writequeue_cache_create(void);
|
2021-12-01 03:47:20 +08:00
|
|
|
struct kmem_cache *dlm_lowcomms_msg_cache_create(void);
|
2006-01-18 17:30:29 +08:00
|
|
|
|
|
|
|
#endif /* __LOWCOMMS_DOT_H__ */
|
|
|
|
|