On Mon, Apr 29, 2013 at 03:51:49PM +0100, Alex Bligh wrote:
> 
> On 29 Apr 2013, at 12:28, Wouter Verhelst wrote:
> 
> > In my view, the select loop would:
> > - Read a request header into a struct nbd_request, and parse it (i.e.,
> > call ntoh* on the right variables of the struct that we read the header
> > into)
> > - Figure out if the request is followed by data; if so, read that data
> > from the socket
> 
> From past experience writing a server, you might want to ask the
> driver for buffer(s) to put this in rather than allocate them yourself.
> For instance, a driver with an O_DIRECT backend would want to page
> align the buffers.

Totally. And a server that uses splice you want a pipe there and
custom read_data/write_data callbacks. That would be one place where I
would want to change the default protocol handling.

In my suggestion the alloc_request() callback handles creating the
memory for the request. Since not every request is a write a seperate
alloc_request_data() callback would make sense.

MfG
        Goswin

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to