[Sheepdog] [PATCH 1/2] change 'write' to 'wr' to avoid declaration shadowing

Liu Yuan namei.unix at gmail.com
Fri Apr 27 06:35:34 CEST 2012


On 04/26/2012 10:45 AM, Li Wenpeng wrote:

> From: levin li <xingke.lwp at taobao.com>
> 
> The argument 'write' of get_vdi_attr() shadows a global
> declaraton in unistd.h which will be involved in my next patch.
> 
> Signed-off-by: levin li <xingke.lwp at taobao.com>
> ---
>  sheep/vdi.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sheep/vdi.c b/sheep/vdi.c
> index c8085c8..6277de8 100644
> --- a/sheep/vdi.c
> +++ b/sheep/vdi.c
> @@ -695,7 +695,7 @@ err:
>  
>  int get_vdi_attr(uint32_t epoch, struct sheepdog_vdi_attr *vattr, int data_len,
>  		 uint32_t vid, uint32_t *attrid, int copies, uint64_t ctime,
> -		 int write, int excl, int delete)
> +		 int wr, int excl, int delete)
>  {
>  	struct sd_vnode *entries = NULL;
>  	struct sheepdog_vdi_attr tmp_attr;
> @@ -722,7 +722,7 @@ int get_vdi_attr(uint32_t epoch, struct sheepdog_vdi_attr *vattr, int data_len,
>  		ret = read_object(entries, nr_vnodes, nr_zones, epoch, oid, (char *)&tmp_attr,
>  				  sizeof(tmp_attr), 0, copies);
>  
> -		if (ret == SD_RES_NO_OBJ && write) {
> +		if (ret == SD_RES_NO_OBJ && wr) {
>  			ret = write_object(entries, nr_vnodes, nr_zones, epoch, oid,
>  					   (char *)vattr, data_len, 0, 0, copies, 1);
>  			if (ret)
> @@ -751,7 +751,7 @@ int get_vdi_attr(uint32_t epoch, struct sheepdog_vdi_attr *vattr, int data_len,
>  					ret = SD_RES_EIO;
>  				else
>  					ret = SD_RES_SUCCESS;
> -			} else if (write) {
> +			} else if (wr) {
>  				ret = write_object(entries, nr_vnodes, nr_zones,
>  						   epoch, oid, (char *)vattr,
>  						   SD_ATTR_OBJ_SIZE, 0, 0, copies, 0);


Applied first one

Thanks,
Yuan



More information about the sheepdog mailing list