[PATCH] smb2 FSCTL_SRV_COPYCHUNK support

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Mar 6 03:39:46 MST 2012


On Tue, Mar 06, 2012 at 12:36:51PM +0100, David Disseldorp wrote:
> > The other one is in the implementation of the async engine.
> > You ordered the different _send, _done and _recv functions
> > so that you do not need prototypes. While this saves a few
> > lines, to me it is much easier to read if the functions are
> > lexically ordered according to their call sequence. First
> > the _send function, then the _done and after that the _recv
> > function. This makes the async flow almost as easy to read
> > as a non-async sequential flow. Can you change that? I know
> > there are examples in the code that do it differently, but I
> > think for new code we should adhere to this convention.
> 
> I normally like to avoid prototypes so that function argument changes
> aren't too arduous, but in this case I guess any future changes would
> likely only touch req or callback private data. I'll shuffle these
> around.

In general, that's true. But to most people async code is
very hard to follow. Thus being able to read almost
sequentially through it makes a huge difference in
understanding. Typically, the _send and _recv functions are
available publically, so you need function prototypes
anyway. And the intermediate _done style callbacks only ever
have one argument: struct tevent_req *subreq.

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list