]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: directly execute copy-on-read copyup operations 7129/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 6 Jan 2016 15:02:52 +0000 (10:02 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 6 Jan 2016 15:02:52 +0000 (10:02 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/AioObjectRequest.cc
src/librbd/CopyupRequest.cc
src/librbd/CopyupRequest.h
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/image/CloseRequest.cc
src/librbd/image/CloseRequest.h

index e02ebd37f5d19a493e669840d5fd507d68746779..2ec53e7a176f9c48373b1a3c7b14c5299cbd604a 100644 (file)
@@ -262,7 +262,7 @@ namespace librbd {
       CopyupRequest *new_req = new CopyupRequest(m_ictx, m_oid, m_object_no,
                                                 m_parent_extents);
       m_ictx->copyup_list[m_object_no] = new_req;
-      new_req->queue_send();
+      new_req->send();
     }
   }
 
index 2fd18dd24495fea6b398cf6f70ce38aa4d77002d..d7713ad166a099921caf6a7edeb445659a819d9b 100644 (file)
@@ -195,18 +195,6 @@ private:
                               &m_copyup_data, 0);
   }
 
-  void CopyupRequest::queue_send()
-  {
-    // TODO: once the ObjectCacher allows reentrant read requests, the finisher
-    // should be eliminated
-    ldout(m_ictx->cct, 20) << __func__ << " " << this
-                          << ": oid " << m_oid << " "
-                          << ", extents " << m_image_extents << dendl;
-    FunctionContext *ctx = new FunctionContext(
-      boost::bind(&CopyupRequest::send, this));
-    m_ictx->copyup_finisher->queue(ctx);
-  }
-
   void CopyupRequest::complete(int r)
   {
     if (should_complete(r)) {
index cbf7d9fa2964da64803413ae054638f1d643b5e1..4d971d847952f7ed3cd3aba7c344f6a0cd67be1f 100644 (file)
@@ -23,7 +23,6 @@ namespace librbd {
     void append_request(AioObjectRequest *req);
 
     void send();
-    void queue_send();
 
     void complete(int r);
 
index 6f33962aa413afb7033c0ce8f9f46ba557f0d26b..154c15a1144255734a8168e90f452b334aad5db0 100644 (file)
@@ -161,7 +161,7 @@ struct C_InvalidateCache : public Context {
       stripe_unit(0), stripe_count(0), flags(0),
       object_cacher(NULL), writeback_handler(NULL), object_set(NULL),
       readahead(),
-      total_bytes_read(0), copyup_finisher(NULL),
+      total_bytes_read(0),
       state(new ImageState<>(this)), exclusive_lock(nullptr),
       object_map(nullptr), aio_work_queue(NULL), op_work_queue(NULL),
       asok_hook(new LibrbdAdminSocketHook(this))
@@ -206,10 +206,6 @@ struct C_InvalidateCache : public Context {
       delete object_set;
       object_set = NULL;
     }
-    if (copyup_finisher != NULL) {
-      delete copyup_finisher;
-      copyup_finisher = NULL;
-    }
     delete[] format_string;
 
     md_ctx.aio_flush();
@@ -279,11 +275,6 @@ struct C_InvalidateCache : public Context {
       object_cacher->start();
     }
 
-    if (clone_copy_on_read) {
-      copyup_finisher = new Finisher(cct);
-      copyup_finisher->start();
-    }
-
     readahead.set_trigger_requests(readahead_trigger_requests);
     readahead.set_max_readahead_size(readahead_max_bytes);
   }
@@ -871,16 +862,6 @@ struct C_InvalidateCache : public Context {
     on_finish->complete(0);
   }
 
-  void ImageCtx::flush_copyup(Context *on_finish) {
-    on_finish = util::create_async_context_callback(*this, on_finish);
-    if (copyup_finisher == nullptr) {
-      on_finish->complete(0);
-      return;
-    }
-
-    copyup_finisher->queue(on_finish);
-  }
-
   void ImageCtx::clear_pending_completions() {
     Mutex::Locker l(completed_reqs_lock);
     ldout(cct, 10) << "clear pending AioCompletion: count="
index 977544a343d38d2463b24816b143a723f6a78294..715fcbb56e188c866c3d9c3ec0e7114c36833c15 100644 (file)
@@ -130,7 +130,6 @@ namespace librbd {
     Readahead readahead;
     uint64_t total_bytes_read;
 
-    Finisher *copyup_finisher;
     std::map<uint64_t, CopyupRequest*> copyup_list;
 
     xlist<AsyncOperation*> async_ops;
@@ -268,8 +267,6 @@ namespace librbd {
     void cancel_async_requests();
     void cancel_async_requests(Context *on_finish);
 
-    void flush_copyup(Context *on_finish);
-
     void apply_metadata_confs();
 
     ObjectMap *create_object_map(uint64_t snap_id);
index 2d7ad38343bbbacdce9fe10f1e7d731de1e27913..57f04a7d8eca5650c1b1456360d97050a80e9c6e 100644 (file)
@@ -180,29 +180,6 @@ void CloseRequest<I>::handle_shut_down_cache(int r) {
   if (r < 0) {
     lderr(cct) << "failed to shut down cache: " << cpp_strerror(r) << dendl;
   }
-  send_flush_copyup();
-}
-
-template <typename I>
-void CloseRequest<I>::send_flush_copyup() {
-  if (m_image_ctx->copyup_finisher == nullptr) {
-    send_flush_op_work_queue();
-    return;
-  }
-
-  CephContext *cct = m_image_ctx->cct;
-  ldout(cct, 10) << this << " " << __func__ << dendl;
-
-  m_image_ctx->flush_copyup(create_context_callback<
-    CloseRequest<I>, &CloseRequest<I>::handle_flush_copyup>(this));
-}
-
-template <typename I>
-void CloseRequest<I>::handle_flush_copyup(int r) {
-  CephContext *cct = m_image_ctx->cct;
-  ldout(cct, 10) << this << " " << __func__ << ": r=" << r << dendl;
-
-  m_image_ctx->copyup_finisher->stop();
   send_flush_op_work_queue();
 }
 
index f22e2dda80b7c1bc66e66e99593f4df44fb105f6..08ace956752ed31ec1c8b8dc44480534bbe0a363 100644 (file)
@@ -49,9 +49,6 @@ private:
    * SHUTDOWN_CACHE
    *    |
    *    v
-   * FLUSH_COPYUP (skip if copyup
-   *    |          disabled)
-   *    v
    * FLUSH_OP_WORK_QUEUE  . . . . .
    *    |                         .
    *    v                         .
@@ -90,9 +87,6 @@ private:
   void send_shut_down_cache();
   void handle_shut_down_cache(int r);
 
-  void send_flush_copyup();
-  void handle_flush_copyup(int r);
-
   void send_flush_op_work_queue();
   void handle_flush_op_work_queue(int r);