[sheepdog] [PATCH v1] sheep/http: remove unnecessary code

Hitoshi Mitake mitake.hitoshi at gmail.com
Sun Jul 27 07:21:46 CEST 2014


At Thu, 24 Jul 2014 20:47:49 +0800,
Bingpeng Zhu wrote:
> 
> In function onode_populate_extents, it is unnecessary to
> add last_ext->data_len, since last_ext->data_len equals
> zero in that condition.
> 
> Signed-off-by: Bingpeng Zhu <nkuzbp at foxmail.com>
> ---
>  sheep/http/kv.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)

Thanks Bingpeng. Robin, could you review this patch?

Thanks,
Hitoshi

> 
> diff --git a/sheep/http/kv.c b/sheep/http/kv.c
> index 6805f12..e92faff 100644
> --- a/sheep/http/kv.c
> +++ b/sheep/http/kv.c
> @@ -732,9 +732,8 @@ static int onode_populate_extents(struct kv_onode *onode,
>  
>  	data_buf = xmalloc(write_buffer_size);
>  	if (last_ext->data_len == 0 && onode->nr_extent == 1) {
> -		offset = last_ext->start * SD_DATA_OBJ_SIZE +
> -			 last_ext->data_len;
> -		last_ext->data_len += req->data_length;
> +		offset = last_ext->start * SD_DATA_OBJ_SIZE;
> +		last_ext->data_len = req->data_length;
>  	} else if (last_ext->data_len > 0) {
>  		offset = last_ext->start * SD_DATA_OBJ_SIZE +
>  			 last_ext->data_len;
> -- 
> 1.7.1
> 
> 
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list