From 8d6a479332691e340dec293cb33a3f36bf8edc65 Mon Sep 17 00:00:00 2001 From: Or Ozeri Date: Mon, 2 Nov 2020 16:41:53 +0200 Subject: librbd: add crypto image dispatch layer This commit adds a crypto image dispatch layer, in addition to the existing crypto object dispatch layer. The single purpose of this layer is to translate logical image offset to "on-disk" offsets, given a crypto header which occupies the beginning of the image data. This calculation is done via a new remap_extents api, which is used in to wrap existing Striper translations between object and image extents. Signed-off-by: Or Ozeri --- src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/test/librbd/crypto') diff --git a/src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc b/src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc index 805a83d75bd..e4e4493cc52 100644 --- a/src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc +++ b/src/test/librbd/crypto/test_mock_CryptoObjectDispatch.cc @@ -55,6 +55,12 @@ CopyupRequest* CopyupRequest< namespace util { +template <> uint64_t get_file_offset( + MockImageCtx *image_ctx, uint64_t object_no, uint64_t offset) { + return Striper::get_file_offset(image_ctx->cct, &image_ctx->layout, + object_no, offset); +} + namespace { struct Mock { -- cgit v1.2.3