]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: remove unused refresh request logic 10770/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 17 Aug 2016 19:16:37 +0000 (15:16 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 23 Aug 2016 16:23:07 +0000 (12:23 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageState.cc
src/librbd/ImageState.h
src/test/librbd/mock/MockImageState.h

index 3e0a3853f066d6e79728bde656b4a26c27cbcdcd..da9f6d967cf33b79288dc2d0f35a58f572f44bc2 100644 (file)
@@ -318,18 +318,6 @@ template <typename I>
 void ImageState<I>::refresh(Context *on_finish) {
   CephContext *cct = m_image_ctx->cct;
   ldout(cct, 20) << __func__ << dendl;
-  refresh(false, on_finish);
-}
-
-template <typename I>
-void ImageState<I>::acquire_lock_refresh(Context *on_finish) {
-  CephContext *cct = m_image_ctx->cct;
-  ldout(cct, 20) << __func__ << dendl;
-  refresh(true, on_finish);
-}
-
-template <typename I>
-void ImageState<I>::refresh(bool acquiring_lock, Context *on_finish) {
 
   m_lock.Lock();
   if (is_closed()) {
@@ -340,7 +328,6 @@ void ImageState<I>::refresh(bool acquiring_lock, Context *on_finish) {
 
   Action action(ACTION_TYPE_REFRESH);
   action.refresh_seq = m_refresh_seq;
-  action.refresh_acquiring_lock = acquiring_lock;
   execute_action_unlock(action, on_finish);
 }
 
@@ -633,7 +620,7 @@ void ImageState<I>::send_refresh_unlock() {
     *m_image_ctx, create_context_callback<
       ImageState<I>, &ImageState<I>::handle_refresh>(this));
   image::RefreshRequest<I> *req = image::RefreshRequest<I>::create(
-    *m_image_ctx, action_context.refresh_acquiring_lock, ctx);
+    *m_image_ctx, false, ctx);
 
   m_lock.Unlock();
   req->send();
index 2e0fb63fbde48534757c907202c1178cb4a7be70..412730e711688659c00afbf3b38dd9813592c199 100644 (file)
@@ -38,7 +38,6 @@ public:
   int refresh();
   int refresh_if_required();
   void refresh(Context *on_finish);
-  void acquire_lock_refresh(Context *on_finish);
 
   void snap_set(const std::string &snap_name, Context *on_finish);
 
@@ -73,7 +72,6 @@ private:
   struct Action {
     ActionType action_type;
     uint64_t refresh_seq = 0;
-    bool refresh_acquiring_lock = false;
     std::string snap_name;
     Context *on_ready = nullptr;
 
@@ -85,8 +83,7 @@ private:
       }
       switch (action_type) {
       case ACTION_TYPE_REFRESH:
-        return (refresh_seq == action.refresh_seq &&
-                refresh_acquiring_lock == action.refresh_acquiring_lock);
+        return (refresh_seq == action.refresh_seq);
       case ACTION_TYPE_SET_SNAP:
         return snap_name == action.snap_name;
       case ACTION_TYPE_LOCK:
@@ -115,8 +112,6 @@ private:
   bool is_transition_state() const;
   bool is_closed() const;
 
-  void refresh(bool acquiring_lock, Context *on_finish);
-
   void append_context(const Action &action, Context *context);
   void execute_next_action_unlock();
   void execute_action_unlock(const Action &action, Context *context);
index 603871b5b46e0cf969792343a07a4bd7019bc04b..59c9da8d69db6c1b815559d347eb8e602cbb39fe 100644 (file)
@@ -13,7 +13,6 @@ namespace librbd {
 struct MockImageState {
   MOCK_CONST_METHOD0(is_refresh_required, bool());
   MOCK_METHOD1(refresh, void(Context*));
-  MOCK_METHOD1(acquire_lock_refresh, void(Context*));
 
   MOCK_METHOD1(open, void(Context*));