[Sheepdog] [PATCH v5 5/7] sheep: add a helper function to get nr_zones

Liu Yuan namei.unix at gmail.com
Wed Oct 19 12:06:20 CEST 2011


From: Liu Yuan <tailai.ly at taobao.com>

Get number of zones from the list.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index fd1f7ce..3406672 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -210,6 +210,15 @@ static void build_node_list(struct list_head *node_list,
 		*nr_nodes = nr;
 }
 
+static int get_zones_nr_from(struct list_head *list)
+{
+	int nr_dummpy, nr_zones;
+	struct sheepdog_node_list_entry nodes[SD_MAX_NODES];
+
+	build_node_list(list, nodes, &nr_dummpy, &nr_zones);
+	return nr_zones;
+}
+
 int get_ordered_sd_node_list(struct sheepdog_node_list_entry *entries)
 {
 	int nr_nodes;
-- 
1.7.6.1




More information about the sheepdog mailing list