Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /******************************************************************************
0003 *******************************************************************************
0004 **
0005 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
0006 **  Copyright (C) 2004-2009 Red Hat, Inc.  All rights reserved.
0007 **
0008 **
0009 *******************************************************************************
0010 ******************************************************************************/
0011 
0012 #ifndef __LOWCOMMS_DOT_H__
0013 #define __LOWCOMMS_DOT_H__
0014 
0015 #include "dlm_internal.h"
0016 
0017 #define DLM_MIDCOMMS_OPT_LEN        sizeof(struct dlm_opts)
0018 #define DLM_MAX_APP_BUFSIZE     (DLM_MAX_SOCKET_BUFSIZE - \
0019                      DLM_MIDCOMMS_OPT_LEN)
0020 
0021 #define CONN_HASH_SIZE 32
0022 
0023 /* This is deliberately very simple because most clusters have simple
0024  * sequential nodeids, so we should be able to go straight to a connection
0025  * struct in the array
0026  */
0027 static inline int nodeid_hash(int nodeid)
0028 {
0029     return nodeid & (CONN_HASH_SIZE-1);
0030 }
0031 
0032 /* switch to check if dlm is running */
0033 extern int dlm_allow_conn;
0034 
0035 int dlm_lowcomms_start(void);
0036 void dlm_lowcomms_shutdown(void);
0037 void dlm_lowcomms_stop(void);
0038 void dlm_lowcomms_exit(void);
0039 int dlm_lowcomms_close(int nodeid);
0040 struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation,
0041                      char **ppc, void (*cb)(void *data),
0042                      void *data);
0043 void dlm_lowcomms_commit_msg(struct dlm_msg *msg);
0044 void dlm_lowcomms_put_msg(struct dlm_msg *msg);
0045 int dlm_lowcomms_resend_msg(struct dlm_msg *msg);
0046 int dlm_lowcomms_connect_node(int nodeid);
0047 int dlm_lowcomms_nodes_set_mark(int nodeid, unsigned int mark);
0048 int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr, int len);
0049 void dlm_midcomms_receive_done(int nodeid);
0050 struct kmem_cache *dlm_lowcomms_writequeue_cache_create(void);
0051 struct kmem_cache *dlm_lowcomms_msg_cache_create(void);
0052 
0053 #endif              /* __LOWCOMMS_DOT_H__ */
0054