[Sheepdog] [PATCH] sheep, sdnet: use is_myself() helper to check target node

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Sep 28 20:38:56 CEST 2011


At Wed, 28 Sep 2011 15:34:44 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  sheep/sdnet.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks!

Kazutaka

> 
> diff --git a/sheep/sdnet.c b/sheep/sdnet.c
> index 94a8ae3..9985bdb 100644
> --- a/sheep/sdnet.c
> +++ b/sheep/sdnet.c
> @@ -641,8 +641,7 @@ int write_object(struct sheepdog_vnode_list_entry *e,
>  
>  		n = obj_to_sheep(e, vnodes, oid, i);
>  
> -		if (memcmp(e[n].addr, sys->this_node.addr, sizeof(e[n].addr)) == 0 &&
> -		    e[n].port == sys->this_node.port) {
> +		if (is_myself(e[n].addr, e[n].port)) {
>  			ret = write_object_local(oid, data, datalen, offset, nr,
>  						 node_version, create);
>  
> @@ -704,8 +703,7 @@ int read_object(struct sheepdog_vnode_list_entry *e,
>  	for (i = 0; i < nr; i++) {
>  		n = obj_to_sheep(e, vnodes, oid, i);
>  
> -		if (memcmp(e[n].addr, sys->this_node.addr, sizeof(e[n].addr)) == 0 &&
> -		    e[n].port == sys->this_node.port) {
> +		if (is_myself(e[n].addr, e[n].port)) {
>  			ret = read_object_local(oid, data, datalen, offset, nr,
>  						node_version);
>  
> -- 
> 1.7.6.1
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list