[sheepdog] [PATCH v2 1/2] sheep: remove invalid usage of current_vnode_info

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Jan 6 09:10:46 CET 2014


The variable current_vnode_info should be treated with the functions
get_vnode_info() and put_vnode_info(). But some part of group.c didn't
follow this rule. This patch fixes the clear problem in
update_cluster_info(), sd_leave_handler() and kick_node_recover().

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/group.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 623fa55..60ff31f 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -648,7 +648,7 @@ static void update_cluster_info(const struct cluster_info *cinfo,
 		sockfd_cache_add_group(nroot);
 	sockfd_cache_add(&joined->nid);
 
-	old_vnode_info = main_thread_get(current_vnode_info);
+	old_vnode_info = get_vnode_info();
 	main_thread_set(current_vnode_info, alloc_vnode_info(nroot));
 
 	get_vdis(nroot, joined);
@@ -928,7 +928,7 @@ main_fn void sd_leave_handler(const struct sd_node *left,
 		/* Mark leave node as gateway only node */
 		sys->this_node.nr_vnodes = 0;
 
-	old_vnode_info = main_thread_get(current_vnode_info);
+	old_vnode_info = get_vnode_info();
 	main_thread_set(current_vnode_info, alloc_vnode_info(nroot));
 	if (sys->cinfo.status == SD_STATUS_OK) {
 		ret = inc_and_log_epoch();
@@ -955,7 +955,7 @@ static void update_node_size(struct sd_node *node)
 
 static void kick_node_recover(void)
 {
-	struct vnode_info *old = main_thread_get(current_vnode_info);
+	struct vnode_info *old = get_vnode_info();
 	int ret;
 
 	main_thread_set(current_vnode_info, alloc_vnode_info(&old->nroot));
-- 
1.7.10.4




More information about the sheepdog mailing list