]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: directly post completions to the asio strand
authorJason Dillaman <dillaman@redhat.com>
Fri, 10 Jul 2020 16:50:54 +0000 (12:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 16 Jul 2020 20:02:55 +0000 (16:02 -0400)
Avoid the unnecessary wrapping of the strand completion in a
bind_executor by just directly posting the completion to the
strand.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/io/AioCompletion.cc

index a50677215818be4554f8ead5e0faf7e2321e9df8..9e1d1e18fe7a3ac8af5bbd86a7b522c01c1c1808 100644 (file)
@@ -157,10 +157,9 @@ void AioCompletion::queue_complete() {
   add_request();
 
   // ensure completion fires in clean lock context
-  boost::asio::post(*ictx->asio_engine, boost::asio::bind_executor(
-    ictx->asio_engine->get_api_strand(), [this]() {
+  boost::asio::post(ictx->asio_engine->get_api_strand(), [this]() {
       complete_request(0);
-    }));
+    });
 }
 
 void AioCompletion::block(CephContext* cct) {
@@ -261,12 +260,11 @@ void AioCompletion::complete_external_callback() {
 
   // ensure librbd external users never experience concurrent callbacks
   // from multiple librbd-internal threads.
-  boost::asio::dispatch(*ictx->asio_engine, boost::asio::bind_executor(
-    ictx->asio_engine->get_api_strand(), [this]() {
+  boost::asio::dispatch(ictx->asio_engine->get_api_strand(), [this]() {
       complete_cb(rbd_comp, complete_arg);
       complete_event_socket();
       put();
-    }));
+    });
 }
 
 void AioCompletion::complete_event_socket() {