]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
rbd: implement layered reads
authorAlex Elder <elder@inktank.com>
Thu, 24 Jan 2013 22:13:36 +0000 (16:13 -0600)
committerAlex Elder <elder@inktank.com>
Mon, 15 Apr 2013 03:29:19 +0000 (22:29 -0500)
commit745c34cda2b08d94a41c8e4f816f658332f55402
tree353a376dc50858d316705890139bf9ccebf19e6e
parent3c38b565af0b07d06f572af4cb78e882131e6ab4
rbd: implement layered reads

Implement layered read requests for format 2 rbd images.

If an rbd image is a clone of a snapshot, the snapshot will be the
clone's "parent" image.  When an object read request on a clone
comes back with ENOENT it indicates that the clone is not yet
populated with that portion of the image's data, and the parent
image should be consulted to satisfy the read.

When this occurs, a new image request is created, directed to the
parent image.  The offset and length of the image are the same as
the image-relative offset and length of the object request that
produced ENOENT.  Data from the parent image therefore satisfies the
object read request for the original image request.

While this code works, it will not be active until we enable the
layering feature (by adding RBD_FEATURE_LAYERING to the value of
RBD_FEATURES_SUPPORTED).

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c