From 3fd24eb2cdb7594ef819b767db9998480cbf1ef8 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 8 Dec 2015 16:25:54 -0500 Subject: [PATCH] librbd: rename ImageRefresh to ImageState This class handles more than just refreshing the image from disk. Signed-off-by: Jason Dillaman --- src/CMakeLists.txt | 2 +- src/librbd/{ImageRefresh.cc => ImageState.cc} | 16 ++++++++-------- src/librbd/{ImageRefresh.h => ImageState.h} | 12 ++++++------ src/librbd/Makefile.am | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename src/librbd/{ImageRefresh.cc => ImageState.cc} (55%) rename src/librbd/{ImageRefresh.h => ImageState.h} (61%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5ada3be176e5..41c6eec3a6c47 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -880,7 +880,7 @@ if(${WITH_RBD}) librbd/DiffIterate.cc librbd/ExclusiveLock.cc librbd/ImageCtx.cc - librbd/ImageRefresh.cc + librbd/ImageState.cc librbd/ImageWatcher.cc librbd/internal.cc librbd/Journal.cc diff --git a/src/librbd/ImageRefresh.cc b/src/librbd/ImageState.cc similarity index 55% rename from src/librbd/ImageRefresh.cc rename to src/librbd/ImageState.cc index 224b1277c7c84..f2ac1219260a0 100644 --- a/src/librbd/ImageRefresh.cc +++ b/src/librbd/ImageState.cc @@ -1,35 +1,35 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#include "librbd/ImageRefresh.h" +#include "librbd/ImageState.h" #include "common/dout.h" #include "common/errno.h" -#include "librbd/image/RefreshRequest.h" +#include "librbd/image/StateRequest.h" #define dout_subsys ceph_subsys_rbd #undef dout_prefix -#define dout_prefix *_dout << "librbd::ImageRefresh: " +#define dout_prefix *_dout << "librbd::ImageState: " namespace librbd { template -ImageRefresh::ImageRefresh(I &image_ctx) : m_image_ctx(image_ctx) { +ImageState::ImageState(I &image_ctx) : m_image_ctx(image_ctx) { } template -bool ImageRefresh::is_refresh_required() const { +bool ImageState::is_refresh_required() const { // TODO future entry point for AIO ops -- to replace ictx_check call return false; } template -void ImageRefresh::refresh(Context *on_finish) { +void ImageState::refresh(Context *on_finish) { // TODO simple state machine to restrict to a single in-progress refresh / snap set - image::RefreshRequest *req = image::RefreshRequest::create( + image::StateRequest *req = image::StateRequest::create( m_image_ctx, on_finish); req->send(); } } // namespace librbd -template class librbd::ImageRefresh; +template class librbd::ImageState; diff --git a/src/librbd/ImageRefresh.h b/src/librbd/ImageState.h similarity index 61% rename from src/librbd/ImageRefresh.h rename to src/librbd/ImageState.h index 4612f96658c10..b323be77a503f 100644 --- a/src/librbd/ImageRefresh.h +++ b/src/librbd/ImageState.h @@ -1,8 +1,8 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_LIBRBD_IMAGE_REFRESH_H -#define CEPH_LIBRBD_IMAGE_REFRESH_H +#ifndef CEPH_LIBRBD_IMAGE_STATE_H +#define CEPH_LIBRBD_IMAGE_STATE_H #include "include/int_types.h" @@ -13,9 +13,9 @@ namespace librbd { class ImageCtx; template -class ImageRefresh { +class ImageState { public: - ImageRefresh(ImageCtxT &image_ctx); + ImageState(ImageCtxT &image_ctx); bool is_refresh_required() const; @@ -28,6 +28,6 @@ private: } // namespace librbd -extern template class librbd::ImageRefresh; +extern template class librbd::ImageState; -#endif // CEPH_LIBRBD_IMAGE_REFRESH_H +#endif // CEPH_LIBRBD_IMAGE_STATE_H diff --git a/src/librbd/Makefile.am b/src/librbd/Makefile.am index f5be6da63ca1f..153b69e4c8178 100644 --- a/src/librbd/Makefile.am +++ b/src/librbd/Makefile.am @@ -19,7 +19,7 @@ librbd_internal_la_SOURCES = \ librbd/DiffIterate.cc \ librbd/ExclusiveLock.cc \ librbd/ImageCtx.cc \ - librbd/ImageRefresh.cc \ + librbd/ImageState.cc \ librbd/ImageWatcher.cc \ librbd/internal.cc \ librbd/Journal.cc \ @@ -93,7 +93,7 @@ noinst_HEADERS += \ librbd/DiffIterate.h \ librbd/ExclusiveLock.h \ librbd/ImageCtx.h \ - librbd/ImageRefresh.h \ + librbd/ImageState.h \ librbd/ImageWatcher.h \ librbd/internal.h \ librbd/Journal.h \ -- 2.39.5