[sheepdog] [PATCH 1/3] simplify exec_req

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Oct 18 08:01:20 CEST 2012


At Thu, 18 Oct 2012 13:37:41 +0800,
Liu Yuan wrote:
> 
> On 10/18/2012 08:49 AM, MORITA Kazutaka wrote:
> > @@ -91,7 +91,7 @@ static int recover_object_from_replica(uint64_t oid, struct sd_vnode *vnode,
> >  	hdr.obj.oid = oid;
> >  	hdr.obj.tgt_epoch = tgt_epoch;
> >  
> > -	ret = sheep_exec_req(&vnode->nid, &hdr, buf, &wlen, &rlen);
> > +	ret = sheep_exec_req(&vnode->nid, &hdr, buf, &rlen);
> >  	if (ret != SD_RES_SUCCESS)
> >  		goto out;
> 
> We actually don't need rlen to indicate how many bytes we read, since we
> only expect a full read, partial read means failure. So I think we can

It is not correct because some operations allow short read:

 - SD_OP_GET_NODE_LIST
 - SD_OP_TRACE_READ_BUF
 - SD_OP_READ_PEER (the current code trims redundant zero bytes to
                    reduce network and disk I/Os)

But, on second thought, I noticed that we can get the read size from
rsp->data_length.  I'll send a v2.

Thanks,

Kazutaka

> completely remove rlen para from sheep_exec_req() and exec_req().
> 
> Thanks,
> Yuan
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list