libceph: add a compatibility check interface

An upcoming change implements semantic change that could lead to
a crash if an old version of the libceph kernel module is used with
a new version of the rbd kernel module.

In order to preclude that possibility, this adds a compatibilty
check interface.  If this interface doesn't exist, the modules are
obviously not compatible.  But if it does exist, this provides a way
of letting the caller know whether it will operate properly with
this libceph module.

Perhaps confusingly, it returns false right now.  The semantic
change mentioned above will make it return true.

This resolves:
    http://tracker.ceph.com/issues/3800

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: don't take extra bio reference for osd client

Currently, if the OSD client finds an osd request has had a bio list
attached to it, it drops a reference to it (or rather, to the first
entry on that list) when the request is released.

The code that added that reference (i.e., the rbd client) is
therefore required to take an extra reference to that first bio
structure.

The osd client doesn't really do anything with the bio pointer other
than transfer it from the osd request structure to outgoing (for
writes) and ingoing (for reads) messages.  So it really isn't the
right place to be taking or dropping references.

Furthermore, the rbd client already holds references to all bio
structures it passes to the osd client, and holds them until the
request is completed.  So there's no need for this extra reference
whatsoever.

So remove the bio_put() call in ceph_osdc_release_request(), as
well as its matching bio_get() call in rbd_osd_req_create().

This change could lead to a crash if old libceph.ko was used with
new rbd.ko.  Add a compatibility check at rbd initialization time to
avoid this possibilty.

This resolves:
    http://tracker.ceph.com/issues/3798    and
    http://tracker.ceph.com/issues/3799

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: temp layering support

Pretend we support layering...

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: probe the parent of an image if present

Call the probe function for the parent device.

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: record aggregate image request result

If any image object request produces a non-zero result, preserve
that as the result of the overall image request.  If multiple
objects have non-zero results, save the first one.

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: define rbd image request type

Define a type for an rbd image request, either a block request
(initiated from the Linux block layer) or a parent request
(initiated to satisfy a layered rbd image request).

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: encapsulate image object end request

Create a helper function that handles the final processing
of an image object request.

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: record image-relative offset in object request

For an image object request we will need to know what offset within
the rbd image the request covers.  Record that when the object
request gets created.

Update the I/O error warnings so they use this so what's reported
is more informative.

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: implement layered reads

First try.  It works, but it needs a LOT of testing.

Signed-off-by: Alex Elder <elder@inktank.com>