}
ImageCtx::~ImageCtx() {
+ ceph_assert(config_watcher == nullptr);
ceph_assert(image_watcher == NULL);
ceph_assert(exclusive_lock == NULL);
ceph_assert(object_map == NULL);
namespace librbd {
struct AsioEngine;
+ template <typename> class ConfigWatcher;
template <typename> class ExclusiveLock;
template <typename> class ImageState;
template <typename> class ImageWatcher;
librados::IoCtx data_ctx;
librados::IoCtx md_ctx;
+ ConfigWatcher<ImageCtx> *config_watcher = nullptr;
ImageWatcher<ImageCtx> *image_watcher;
Journal<ImageCtx> *journal;
#include "librbd/image/CloseRequest.h"
#include "common/dout.h"
#include "common/errno.h"
+#include "librbd/ConfigWatcher.h"
#include "librbd/ExclusiveLock.h"
#include "librbd/ImageCtx.h"
#include "librbd/ImageState.h"
template <typename I>
void CloseRequest<I>::send() {
+ if (m_image_ctx->config_watcher != nullptr) {
+ m_image_ctx->config_watcher->shut_down();
+
+ delete m_image_ctx->config_watcher;
+ m_image_ctx->config_watcher = nullptr;
+ }
+
send_block_image_watcher();
}
#include "common/dout.h"
#include "common/errno.h"
#include "cls/rbd/cls_rbd_client.h"
+#include "librbd/ConfigWatcher.h"
#include "librbd/ImageCtx.h"
#include "librbd/PluginRegistry.h"
#include "librbd/Utils.h"
CephContext *cct = m_image_ctx->cct;
ldout(cct, 10) << this << " " << __func__ << dendl;
+ m_image_ctx->config_watcher = ConfigWatcher<I>::create(*m_image_ctx);
+ m_image_ctx->config_watcher->init();
+
using klass = OpenRequest<I>;
RefreshRequest<I> *req = RefreshRequest<I>::create(
*m_image_ctx, false, m_skip_open_parent_image,