Skip to contentSkip to conversation

ocfs2/cluster: support IPv6 socket connection between nodes

PATCH New piaojun 1 participant 1 message Oct 25, 2018 OCFS2

lore
Share & tools
lore

piaojun

author
#0 lore raw

PATCH 3/5 ocfs2/cluster: support IPv6 socket connection between nodes

Both IPv4 and IPv6 will be supported when connecting or accepting other nodes in cluster according to configuration by uppper user.

---
 fs/ocfs2/cluster/nodemanager.c |   4 +-
 fs/ocfs2/cluster/nodemanager.h |   2 +-
 fs/ocfs2/cluster/tcp.c         | 190 ++++++++++++++++++++++++++++++-----------
 3 files changed, 141 insertions(+), 55 deletions(-)
fs/ocfs2/cluster/nodemanager.c +2 -2
index 292f5dd..6813517 100644
@@ -115,7 +115,7 @@ static struct o2nm_node *o2nm_node_ip_tree_lookup(struct o2nm_cluster *cluster,
 	return ret;
 }
 
-struct o2nm_node *o2nm_get_node_by_ip(__be32 addr)
+struct o2nm_node *o2nm_get_node_by_ip(u8 addr[])
 {
 	struct o2nm_node *node = NULL;
 	struct o2nm_cluster *cluster = o2nm_single_cluster;
@@ -124,7 +124,7 @@ struct o2nm_node *o2nm_get_node_by_ip(__be32 addr)
 		goto out;
 
 	read_lock(&cluster->cl_nodes_lock);
-	node = o2nm_node_ip_tree_lookup(cluster, (u8 *)&addr, NULL, NULL);
+	node = o2nm_node_ip_tree_lookup(cluster, addr, NULL, NULL);
 	if (node)
 		config_item_get(&node->nd_item);
 	read_unlock(&cluster->cl_nodes_lock);
fs/ocfs2/cluster/nodemanager.h +1 -1
index 1f3cfc5..e5f8701 100644
@@ -85,7 +85,7 @@ struct o2nm_cluster {
 
 int o2nm_configured_node_map(unsigned long *map, unsigned bytes);
 struct o2nm_node *o2nm_get_node_by_num(u8 node_num);
-struct o2nm_node *o2nm_get_node_by_ip(__be32 addr);
+struct o2nm_node *o2nm_get_node_by_ip(u8 addr[]);
 void o2nm_node_get(struct o2nm_node *node);
 void o2nm_node_put(struct o2nm_node *node);
 
fs/ocfs2/cluster/tcp.c +138 -52

284 lines not on this page · raw message