All of lore.kernel.org
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/dlm_controld dlm_daemon.h member ...
Date: 10 Dec 2007 16:17:07 -0000	[thread overview]
Message-ID: <20071210161707.19542.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-12-10 16:17:07

Modified files:
	group/dlm_controld: dlm_daemon.h member_cman.c 

Log message:
	Add multi-path capability. Each address we get from cman is now
	passed into the DLM.
	
	It's still incumbent on cluster.conf to set the transport to sctp.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/dlm_controld/dlm_daemon.h.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/dlm_controld/member_cman.c.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- cluster/group/dlm_controld/dlm_daemon.h	2007/08/17 21:17:53	1.13
+++ cluster/group/dlm_controld/dlm_daemon.h	2007/12/10 16:17:06	1.14
@@ -56,6 +56,7 @@
 #define MAXCON		4
 #define MAXNAME		255
 #define MAX_NODES	256 /* should be same as MAX_GROUP_MEMBERS */
+#define MAX_NODE_ADDRESSES 4
 
 extern char *prog_name;
 extern int daemon_debug_opt;
--- cluster/group/dlm_controld/member_cman.c	2007/07/24 18:15:43	1.8
+++ cluster/group/dlm_controld/member_cman.c	2007/12/10 16:17:06	1.9
@@ -68,7 +68,10 @@
 
 static void statechange(void)
 {
-	int i, rv;
+	int i, j, rv;
+	struct cman_node_address addrs[MAX_NODE_ADDRESSES];
+	int num_addrs;
+	struct cman_node_address *addrptr = addrs;
 
 	old_node_count = cman_node_count;
 	memcpy(&old_nodes, &cman_nodes, sizeof(old_nodes));
@@ -96,14 +99,25 @@
 		if (cman_nodes[i].cn_member &&
 		    !is_old_member(cman_nodes[i].cn_nodeid)) {
 
+			rv = cman_get_node_addrs(ch, cman_nodes[i].cn_nodeid,
+						 MAX_NODE_ADDRESSES,
+						 &num_addrs, addrs);
+			if (rv < 0) {
+				log_debug("cman_get_node_addrs failed, falling back to single-homed. ");
+				num_addrs = 1;
+				addrptr = &cman_nodes[i].cn_address;
+			}
+
 			log_debug("cman: node %d added",
 				  cman_nodes[i].cn_nodeid);
 
-			add_configfs_node(cman_nodes[i].cn_nodeid,
-					  cman_nodes[i].cn_address.cna_address,
-					  cman_nodes[i].cn_address.cna_addrlen,
-					  (cman_nodes[i].cn_nodeid ==
-					   our_nodeid));
+			for (j = 0; j < num_addrs; j++) {
+				add_configfs_node(cman_nodes[i].cn_nodeid,
+						  addrptr[j].cna_address,
+						  addrptr[j].cna_addrlen,
+						  (cman_nodes[i].cn_nodeid ==
+						   our_nodeid));
+			}
 		}
 	}
 }



                 reply	other threads:[~2007-12-10 16:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071210161707.19542.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.