debian: Initial import of the debian build files

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Init the default pipe fd / event id from start

This need to be initialized ASAP so that if it fails, we can detect
they're not initialized.

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Fix the cleanup process

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Rename pending -> inflight

When I'll introduce deferred, inflight is a better name to design
requests that have indeed been sent to the cluster

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: td_rbd_request -> tdrbd_request

All other struct/funcs have the tdrbd_ prefix, so use that

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Move all the request submission logic in an helper

This is preparation for request merging support where we may need
to flush a pending requests at several places in the code.

Once an attempt is made to submit a request, all the sub treq
will be taken care of. Either directly if there is an error, or
upon completion. So the user must _not_ call td_complete_req
himself once submission has been attempted !

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Add support for multiple td_request inside a tdrbd_request

This is preparation for request merging support.

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Add request merging support

We know that xen may slice stuff into 11*4096 bytes chunks.

So if we get a request of this size, we hold onto it until
to see if we can't merge this request with the next.

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Add a bunch of statistics about merging

This allows to find out what's going on and see where/when
requests are issued, to hopefully guide toward better merging
strategies.

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
block-rbd: Allow configuration of the maximum merge size

Syntax is to use max_merge_size=N option (N being in bytes)

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>