]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: introduce reduce_parent_overlap() and switch overlap API
authorIlya Dryomov <idryomov@gmail.com>
Fri, 14 Oct 2022 14:20:24 +0000 (16:20 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 4 Dec 2022 17:19:19 +0000 (18:19 +0100)
commitc97b7c4e8b366c00108f50781b7f45d5324a5c80
treee9d0dadbacdd73e4f2a76c71c9342fe990ee3f34
parent50070a78a899df5249d8d0c69f8fe417d8b36410
librbd: introduce reduce_parent_overlap() and switch overlap API

When encryption is loaded, rbd_get_overlap() and Image::overlap() now
return "effective" overlap, similar to rbd_get_size() and Image::size().
Previously, returned overlap could have been bigger than "effective"
size.

Note that get_effective_image_size() successor doesn't take snap_id
because passing anything but ictx->snap_id was broken.  Since the size
of the crypto header is stored in the crypto header itself, image areas
are defined only for the "opened at" snap_id.  Getting "effective" size
for an arbitrary snapshot requires actually opening it and loading
encryption on it.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/internal.cc
src/librbd/io/ImageRequest.cc
src/test/librbd/mock/MockImageCtx.h