[sheepdog] [PATCH 04/14] collie: remove master column from node list

MORITA Kazutaka morita.kazutaka at gmail.com
Sat Aug 10 17:58:45 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

We removed a master node from cluster drivers, so the master column in
the node list is meaningless now.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/collie.c          |    2 --
 collie/collie.h          |    1 -
 collie/node.c            |   16 +++-------------
 include/sheepdog_proto.h |    2 +-
 sheep/group.c            |    1 -
 5 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index 7ea32ec..6982690 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -48,7 +48,6 @@ uint32_t sd_epoch;
 struct sd_node sd_nodes[SD_MAX_NODES];
 struct sd_vnode sd_vnodes[SD_MAX_VNODES];
 int sd_nodes_nr, sd_vnodes_nr;
-unsigned master_idx;
 
 int update_node_list(int max_nodes)
 {
@@ -92,7 +91,6 @@ int update_node_list(int max_nodes)
 	memcpy(sd_nodes, buf, size);
 	sd_vnodes_nr = nodes_to_vnodes(sd_nodes, sd_nodes_nr, sd_vnodes);
 	sd_epoch = hdr.epoch;
-	master_idx = rsp->node.master_idx;
 out:
 	if (buf)
 		free(buf);
diff --git a/collie/collie.h b/collie/collie.h
index fc06ab8..2e4dc6d 100644
--- a/collie/collie.h
+++ b/collie/collie.h
@@ -59,7 +59,6 @@ extern uint32_t sd_epoch;
 extern struct sd_node sd_nodes[SD_MAX_NODES];
 extern struct sd_vnode sd_vnodes[SD_MAX_VNODES];
 extern int sd_nodes_nr, sd_vnodes_nr;
-extern unsigned master_idx;
 
 bool is_current(const struct sd_inode *i);
 char *size_to_str(uint64_t _size, char *str, int str_size);
diff --git a/collie/node.c b/collie/node.c
index 9307b7f..586ca68 100644
--- a/collie/node.c
+++ b/collie/node.c
@@ -31,25 +31,15 @@ static int node_list(int argc, char **argv)
 	int i;
 
 	if (!raw_output)
-		printf("M   Id   Host:Port         V-Nodes       Zone\n");
+		printf("  Id   Host:Port         V-Nodes       Zone\n");
 	for (i = 0; i < sd_nodes_nr; i++) {
 		char data[128];
 
 		addr_to_str(data, sizeof(data), sd_nodes[i].nid.addr,
 			    sd_nodes[i].nid.port);
 
-		if (i == master_idx) {
-			if (highlight)
-				printf(TEXT_BOLD);
-			printf(raw_output ? "* %d %s %d %d\n" : "* %4d   %-20s\t%2d%11d\n",
-			       i, data, sd_nodes[i].nr_vnodes,
-			       sd_nodes[i].zone);
-			if (highlight)
-				printf(TEXT_NORMAL);
-		} else
-			printf(raw_output ? "- %d %s %d %d\n" : "- %4d   %-20s\t%2d%11d\n",
-			       i, data, sd_nodes[i].nr_vnodes,
-			       sd_nodes[i].zone);
+		printf(raw_output ? "%d %s %d %d\n" : "%4d   %-20s\t%2d%11d\n",
+		       i, data, sd_nodes[i].nr_vnodes, sd_nodes[i].zone);
 	}
 
 	return EXIT_SUCCESS;
diff --git a/include/sheepdog_proto.h b/include/sheepdog_proto.h
index 4e302e9..06523ea 100644
--- a/include/sheepdog_proto.h
+++ b/include/sheepdog_proto.h
@@ -180,7 +180,7 @@ struct sd_rsp {
 			uint32_t	__pad;
 			uint32_t	nr_nodes;
 			uint32_t	local_idx;
-			uint32_t	master_idx;
+			uint32_t	__reserved;
 			uint64_t	store_size;
 			uint64_t	store_free;
 		} node;
diff --git a/sheep/group.c b/sheep/group.c
index 9bc8072..6dcafec 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -161,7 +161,6 @@ int local_get_node_list(const struct sd_req *req, struct sd_rsp *rsp,
 		rsp->node.local_idx = 0;
 	}
 
-	rsp->node.master_idx = -1;
 	return SD_RES_SUCCESS;
 }
 
-- 
1.7.9.5



More information about the sheepdog mailing list