]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: add work queue for op completions
authorJason Dillaman <dillaman@redhat.com>
Wed, 8 Apr 2015 21:24:08 +0000 (17:24 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 28 Jul 2015 20:34:22 +0000 (16:34 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 21f990efe6c6d710376d5b1a49fc8cd53aa020e6)

src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/internal.cc

index a68a906003038c7ac6e96350f0a6cb92d1c4e6f0..3d76c75478e2d400a6fa126d830e1679740f89a9 100644 (file)
@@ -81,7 +81,7 @@ public:
       object_cacher(NULL), writeback_handler(NULL), object_set(NULL),
       readahead(),
       total_bytes_read(0), copyup_finisher(NULL),
-      object_map(*this), aio_work_queue(NULL)
+      object_map(*this), aio_work_queue(NULL), op_work_queue(NULL)
   {
     md_ctx.dup(p);
     data_ctx.dup(p);
@@ -138,6 +138,9 @@ public:
     aio_work_queue = new ContextWQ("librbd::aio_work_queue",
                                    cct->_conf->rbd_op_thread_timeout,
                                    thread_pool_singleton);
+    op_work_queue = new ContextWQ("librbd::op_work_queue",
+                                  cct->_conf->rbd_op_thread_timeout,
+                                  thread_pool_singleton);
   }
 
   ImageCtx::~ImageCtx() {
@@ -160,6 +163,7 @@ public:
     }
     delete[] format_string;
 
+    delete op_work_queue;
     delete aio_work_queue;
   }
 
index 47134e2f19115b861cc83ad17d215ea623e78817..f9a88784e18f9757d249867b96639d2fd68eca2d 100644 (file)
@@ -132,6 +132,7 @@ namespace librbd {
     xlist<AsyncResizeRequest*> async_resize_reqs;
 
     ContextWQ *aio_work_queue;
+    ContextWQ *op_work_queue;
 
     /**
      * Either image_name or image_id must be set.
index fbec53de27b40dddc98cef75ceebd744e85a7088..be088bd1a151173c7f86b3ec8cb1c2a8011cdf2b 100644 (file)
@@ -2472,6 +2472,8 @@ reprotect_and_return_err:
       flush(ictx);
     }
 
+    ictx->op_work_queue->drain();
+
     if (ictx->copyup_finisher != NULL) {
       ictx->copyup_finisher->wait_for_empty();
       ictx->copyup_finisher->stop();