Commit 6ed7257b authored by Patrick Caulfield's avatar Patrick Caulfield Committed by Steven Whitehouse

[DLM] Consolidate transport protocols

This patch consolidates the TCP & SCTP protocols for the DLM into a single file
and makes it switchable at run-time (well, at least before the DLM actually
starts up!)

For RHEL5 this patch requires Neil Horman's patch that expands the in-kernel
socket API but that has already been twice ACKed so it should be OK.

The patch adds a new lowcomms.c file that replaces the existing lowcomms-sctp.c
& lowcomms-tcp.c files.
Signed-off-By: default avatarPatrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent fc7c44f0
...@@ -3,36 +3,19 @@ menu "Distributed Lock Manager" ...@@ -3,36 +3,19 @@ menu "Distributed Lock Manager"
config DLM config DLM
tristate "Distributed Lock Manager (DLM)" tristate "Distributed Lock Manager (DLM)"
depends on SYSFS && (IPV6 || IPV6=n) depends on IPV6 || IPV6=n
select CONFIGFS_FS select CONFIGFS_FS
select IP_SCTP if DLM_SCTP select IP_SCTP
help help
A general purpose distributed lock manager for kernel or userspace A general purpose distributed lock manager for kernel or userspace
applications. applications.
choice
prompt "Select DLM communications protocol"
depends on DLM
default DLM_TCP
help
The DLM Can use TCP or SCTP for it's network communications.
SCTP supports multi-homed operations whereas TCP doesn't.
However, SCTP seems to have stability problems at the moment.
config DLM_TCP
bool "TCP/IP"
config DLM_SCTP
bool "SCTP"
endchoice
config DLM_DEBUG config DLM_DEBUG
bool "DLM debugging" bool "DLM debugging"
depends on DLM depends on DLM
help help
Under the debugfs mount point, the name of each lockspace will Under the debugfs mount point, the name of each lockspace will
appear as a file in the "dlm" directory. The output is the appear as a file in the "dlm" directory. The output is the
list of resource and locks the local node knows about. list of resource and locks the local node knows about.
endmenu endmenu
...@@ -8,14 +8,12 @@ dlm-y := ast.o \ ...@@ -8,14 +8,12 @@ dlm-y := ast.o \
member.o \ member.o \
memory.o \ memory.o \
midcomms.o \ midcomms.o \
lowcomms.o \
rcom.o \ rcom.o \
recover.o \ recover.o \
recoverd.o \ recoverd.o \
requestqueue.o \ requestqueue.o \
user.o \ user.o \
util.o util.o
dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o
dlm-$(CONFIG_DLM_TCP) += lowcomms-tcp.o
dlm-$(CONFIG_DLM_SCTP) += lowcomms-sctp.o
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
******************************************************************************* *******************************************************************************
** **
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
** **
** This copyrighted material is made available to anyone wishing to use, ** This copyrighted material is made available to anyone wishing to use,
** modify, copy, or redistribute it subject to the terms and conditions ** modify, copy, or redistribute it subject to the terms and conditions
...@@ -89,6 +89,7 @@ struct cluster { ...@@ -89,6 +89,7 @@ struct cluster {
unsigned int cl_toss_secs; unsigned int cl_toss_secs;
unsigned int cl_scan_secs; unsigned int cl_scan_secs;
unsigned int cl_log_debug; unsigned int cl_log_debug;
unsigned int cl_protocol;
}; };
enum { enum {
...@@ -101,6 +102,7 @@ enum { ...@@ -101,6 +102,7 @@ enum {
CLUSTER_ATTR_TOSS_SECS, CLUSTER_ATTR_TOSS_SECS,
CLUSTER_ATTR_SCAN_SECS, CLUSTER_ATTR_SCAN_SECS,
CLUSTER_ATTR_LOG_DEBUG, CLUSTER_ATTR_LOG_DEBUG,
CLUSTER_ATTR_PROTOCOL,
}; };
struct cluster_attribute { struct cluster_attribute {
...@@ -159,6 +161,7 @@ CLUSTER_ATTR(recover_timer, 1); ...@@ -159,6 +161,7 @@ CLUSTER_ATTR(recover_timer, 1);
CLUSTER_ATTR(toss_secs, 1); CLUSTER_ATTR(toss_secs, 1);
CLUSTER_ATTR(scan_secs, 1); CLUSTER_ATTR(scan_secs, 1);
CLUSTER_ATTR(log_debug, 0); CLUSTER_ATTR(log_debug, 0);
CLUSTER_ATTR(protocol, 0);
static struct configfs_attribute *cluster_attrs[] = { static struct configfs_attribute *cluster_attrs[] = {
[CLUSTER_ATTR_TCP_PORT] = &cluster_attr_tcp_port.attr, [CLUSTER_ATTR_TCP_PORT] = &cluster_attr_tcp_port.attr,
...@@ -170,6 +173,7 @@ static struct configfs_attribute *cluster_attrs[] = { ...@@ -170,6 +173,7 @@ static struct configfs_attribute *cluster_attrs[] = {
[CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs.attr, [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs.attr,
[CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs.attr, [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs.attr,
[CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug.attr, [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug.attr,
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol.attr,
NULL, NULL,
}; };
...@@ -904,6 +908,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num) ...@@ -904,6 +908,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
#define DEFAULT_TOSS_SECS 10 #define DEFAULT_TOSS_SECS 10
#define DEFAULT_SCAN_SECS 5 #define DEFAULT_SCAN_SECS 5
#define DEFAULT_LOG_DEBUG 0 #define DEFAULT_LOG_DEBUG 0
#define DEFAULT_PROTOCOL 0
struct dlm_config_info dlm_config = { struct dlm_config_info dlm_config = {
.ci_tcp_port = DEFAULT_TCP_PORT, .ci_tcp_port = DEFAULT_TCP_PORT,
...@@ -914,6 +919,7 @@ struct dlm_config_info dlm_config = { ...@@ -914,6 +919,7 @@ struct dlm_config_info dlm_config = {
.ci_recover_timer = DEFAULT_RECOVER_TIMER, .ci_recover_timer = DEFAULT_RECOVER_TIMER,
.ci_toss_secs = DEFAULT_TOSS_SECS, .ci_toss_secs = DEFAULT_TOSS_SECS,
.ci_scan_secs = DEFAULT_SCAN_SECS, .ci_scan_secs = DEFAULT_SCAN_SECS,
.ci_log_debug = DEFAULT_LOG_DEBUG .ci_log_debug = DEFAULT_LOG_DEBUG,
.ci_protocol = DEFAULT_PROTOCOL
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
******************************************************************************* *******************************************************************************
** **
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
** **
** This copyrighted material is made available to anyone wishing to use, ** This copyrighted material is made available to anyone wishing to use,
** modify, copy, or redistribute it subject to the terms and conditions ** modify, copy, or redistribute it subject to the terms and conditions
...@@ -26,6 +26,7 @@ struct dlm_config_info { ...@@ -26,6 +26,7 @@ struct dlm_config_info {
int ci_toss_secs; int ci_toss_secs;
int ci_scan_secs; int ci_scan_secs;
int ci_log_debug; int ci_log_debug;
int ci_protocol;
}; };
extern struct dlm_config_info dlm_config; extern struct dlm_config_info dlm_config;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment