summaryrefslogtreecommitdiffstats
path: root/src/librbd/ImageCtx.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/librbd/ImageCtx.cc')
-rw-r--r--src/librbd/ImageCtx.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc
index 01b7847c086..f4cd7e5f75d 100644
--- a/src/librbd/ImageCtx.cc
+++ b/src/librbd/ImageCtx.cc
@@ -30,6 +30,7 @@
#include "librbd/exclusive_lock/AutomaticPolicy.h"
#include "librbd/exclusive_lock/StandardPolicy.h"
#include "librbd/crypto/EncryptionFormat.h"
+#include "librbd/crypto/CryptoInterface.h"
#include "librbd/io/AioCompletion.h"
#include "librbd/io/AsyncOperation.h"
#include "librbd/io/ImageDispatcher.h"
@@ -945,6 +946,13 @@ librados::IoCtx duplicate_io_ctx(librados::IoCtx& io_ctx) {
return new Journal<ImageCtx>(*this);
}
+ uint64_t ImageCtx::get_data_offset() const {
+ if (encryption_format != nullptr) {
+ return encryption_format->get_crypto()->get_data_offset();
+ }
+ return 0;
+ }
+
void ImageCtx::set_image_name(const std::string &image_name) {
// update the name so rename can be invoked repeatedly
std::shared_lock owner_locker{owner_lock};