[sheepdog] [Sheepdog] [PATCH] collie: allow explicit read sizes that are not a multiple of 512

Liu Yuan namei.unix at gmail.com
Wed May 16 04:43:25 CEST 2012


On 05/16/2012 12:54 AM, Christoph Hellwig wrote:

> Collie vdi read already does can handle read sizes smaller than a block,
> which is used when reading data to stdout without an explicit size argument.
> Also allow using this code when an explicit size argument is given.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> 
> ---
>  collie/vdi.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> Index: sheepdog/collie/vdi.c
> ===================================================================
> --- sheepdog.orig/collie/vdi.c	2012-05-15 11:02:08.399956846 +0200
> +++ sheepdog/collie/vdi.c	2012-05-15 18:44:54.711985004 +0200
> @@ -1118,10 +1118,6 @@ static int vdi_read(int argc, char **arg
>  			ret = parse_option_size(argv[optind++], &total);
>  			if (ret < 0)
>  				return EXIT_USAGE;
> -			if (total % 512 != 0) {
> -				fprintf(stderr, "Read length must be block-aligned\n");
> -				return EXIT_USAGE;
> -			}
>  		}
>  	}
>  


Applied, thanks.

Yuan



More information about the sheepdog mailing list