[sheepdog] [PATCH v2] dog: remove needless checking of vdi creation

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jan 22 01:51:30 CET 2014


At Wed, 22 Jan 2014 09:48:25 +0900,
Hitoshi Mitake wrote:
> 
> The removed check can be done in sheep side.
> 
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
> 
> v2: remove the checking instead of changing

This patch depends on Yuan's dog: fix improper typed 'ret' in 'vdi
create'. If it seems to be good, please apply after the patch.

Thanks,
Hitoshi

> 
>  dog/vdi.c |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/dog/vdi.c b/dog/vdi.c
> index 162382c..c50cd72 100644
> --- a/dog/vdi.c
> +++ b/dog/vdi.c
> @@ -578,7 +578,7 @@ static int vdi_create(int argc, char **argv)
>  	uint64_t size;
>  	uint32_t vid;
>  	uint64_t oid;
> -	uint32_t idx, max_idx, nr_copies = vdi_cmd_data.nr_copies;
> +	uint32_t idx, max_idx;
>  	struct sd_inode *inode = NULL;
>  	int ret;
>  
> @@ -603,12 +603,6 @@ static int vdi_create(int argc, char **argv)
>  		return EXIT_USAGE;
>  	}
>  
> -	if (nr_copies > sd_nodes_nr) {
> -		sd_err("There are not enough nodes(%d) to hold the copies(%d)",
> -		       sd_nodes_nr, nr_copies);
> -		return EXIT_USAGE;
> -	}
> -
>  	ret = do_vdi_create(vdiname, size, 0, &vid, false,
>  			    vdi_cmd_data.nr_copies, vdi_cmd_data.copy_policy,
>  			    vdi_cmd_data.store_policy);
> -- 
> 1.7.10.4
> 



More information about the sheepdog mailing list