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: 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.  Move the assignment of the offset and length
in rbd_request_fn() so they're always valid for the warning message.

Rename a local variable to fit the convention used everywhere else.

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

There are several Boolean values we'll be maintaining for image
requests.  Switch from the single write_request field to a
general-purpose flags field, and use one if its bits to represent
the direction of I/O for the image request.  Define helper functions
for setting and testing that flag.

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

Define a flag indicating whether an image request originated from
the Linux block layer (from blk_fetch_request()) or whether it was
initiated in order to satisfy an object request for a child image
of a layered rbd device.  Initially, only block requests are used.

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

Define a flag indicating whether an image request is for a layered
image (one with a parent image to which requests will be redirected
the target object of a request does not exist).

Signed-off-by: Alex Elder <elder@inktank.com>
rbd: encapsulate osd request creation for image bios

Pull the code that creates an osd request for an image object into
its own function.

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

Encapsulate the code that completes processing of an object request
that's part of an image request.

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