[sheepdog] [PATCH v3 1/3] sheep: rework update node logic

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Jul 10 10:09:34 CEST 2013


At Wed, 10 Jul 2013 14:59:33 +0800,
Liu Yuan wrote:
> 
> @@ -343,6 +346,17 @@ static bool __corosync_dispatch_one(struct corosync_event *cevent)
>  		sd_notify_handler(&cevent->sender.ent, cevent->msg,
>  						 cevent->msg_len);
>  		break;
> +	case COROSYNC_EVENT_TYPE_UPDATE_NODE:
> +		node = &cevent->sender.ent;
> +
> +		if (node_eq(node, &this_node.ent))
> +		    this_node.ent = *node;

Use tabs for indentations.

> +
> +		idx = find_sd_node(cpg_nodes, nr_cpg_nodes, node);
> +		assert(idx >= 0);
> +		cpg_nodes[idx].ent = *node;
> +		sd_update_node_handler(node);
> +		break;
>  	}
>  
>  	return true;


> @@ -724,18 +695,7 @@ static int cluster_reweight(const struct sd_req *req, struct sd_rsp *rsp,
>  			    void *data)
>  {
>  	if (node_size_varied())
> -		reweight_node();
> -
> -	return SD_RES_SUCCESS;
> -}
> -
> -static int cluster_update_size(const struct sd_req *req, struct sd_rsp *rsp,
> -			       void *data)
> -{
> -	struct sd_node *node = (struct sd_node *)data;
> -
> -	update_node_size(node);
> -	kick_node_recover();
> +		sys->cdrv->update_node(&sys->this_node);

Return the result of cdrv->update_node on error.

Thanks,

Kazutaka



More information about the sheepdog mailing list