]> git-server-git.apps.pok.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>
Thu, 4 Jun 2015 20:49:51 +0000 (16:49 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/internal.cc

index 20a9ded3dc491bbdb269b3143b6d24999fedc504..1393de60aeffda48a68d0c8d9f7685b8b16fe537 100644 (file)
@@ -84,7 +84,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);
@@ -100,6 +100,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() {
@@ -122,6 +125,7 @@ public:
     }
     delete[] format_string;
 
+    delete op_work_queue;
     delete aio_work_queue;
   }
 
index 3402e6d18bdc4fa696acac32f5d0dd6712a867a4..3d8d1f943a13a7e42aed3fb2802bc7baad94747a 100644 (file)
@@ -132,6 +132,7 @@ namespace librbd {
     xlist<AsyncResizeRequest*> async_resize_reqs;
 
     ContextWQ *aio_work_queue;
+    ContextWQ *op_work_queue;
 
     // Configuration
     static const string METADATA_CONF_PREFIX;
index d076ab1120bcae65548036adf3a3379f0d0d2a87..e9df16f3613a86141a89fe48a604d92b7cd5eb7b 100644 (file)
@@ -2826,6 +2826,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();