static struct listen_connection listen_con;
static struct sockaddr_storage *dlm_local_addr[DLM_MAX_ADDR_COUNT];
static int dlm_local_count;
-int dlm_allow_conn;
/* Work queues */
static struct workqueue_struct *recv_workqueue;
static void process_recv_sockets(struct work_struct *work);
static void process_send_sockets(struct work_struct *work);
+bool dlm_lowcomms_is_running(void)
+{
+ return !!listen_con.sock;
+}
+
static void writequeue_entry_ctor(void *data)
{
struct writequeue_entry *entry = data;
static void lowcomms_listen_data_ready(struct sock *sk)
{
- if (!dlm_allow_conn)
- return;
-
queue_work(recv_workqueue, &listen_con.rwork);
}
{
int idx;
- /* Set all the flags to prevent any
- * socket activity.
- */
- dlm_allow_conn = 0;
+ restore_callbacks(listen_con.sock);
if (recv_workqueue)
flush_workqueue(recv_workqueue);
if (error)
goto fail_local;
- dlm_allow_conn = 1;
-
/* Start listening */
switch (dlm_config.ci_protocol) {
case DLM_PROTO_TCP:
fail_listen:
dlm_proto_ops = NULL;
fail_proto_ops:
- dlm_allow_conn = 0;
work_stop();
fail_local:
deinit_local();
return nodeid & (CONN_HASH_SIZE-1);
}
-/* switch to check if dlm is running */
-extern int dlm_allow_conn;
+/* check if dlm is running */
+bool dlm_lowcomms_is_running(void);
int dlm_lowcomms_start(void);
void dlm_lowcomms_shutdown(void);