]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: image dispatch spec tids are assigned by dispatcher
authorJason Dillaman <dillaman@redhat.com>
Tue, 1 Sep 2020 15:17:41 +0000 (11:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Sep 2020 03:52:32 +0000 (23:52 -0400)
This was a legacy implementation where it was assigned by the ImageRequestWQ
and therefore needs to be part of the factory methods.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/api/Io.cc
src/librbd/io/ImageDispatchSpec.h

index 7c2d10717294fc08cda289fb80e498c508f20a7a..139a216ea337bde7bbe0333ab26d7861dbbabcd0 100644 (file)
@@ -263,7 +263,7 @@ void Io<I>::aio_write(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off,
 
   auto req = io::ImageDispatchSpec::create_write(
     image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
-    std::move(bl), op_flags, trace, 0);
+    std::move(bl), op_flags, trace);
   req->send();
 }
 
@@ -294,7 +294,7 @@ void Io<I>::aio_discard(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off,
 
   auto req = io::ImageDispatchSpec::create_discard(
     image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
-    discard_granularity_bytes, trace, 0);
+    discard_granularity_bytes, trace);
   req->send();
 }
 
@@ -326,7 +326,7 @@ void Io<I>::aio_write_same(I &image_ctx, io::AioCompletion *aio_comp,
 
   auto req = io::ImageDispatchSpec::create_write_same(
     image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
-    std::move(bl), op_flags, trace, 0);
+    std::move(bl), op_flags, trace);
   req->send();
 }
 
@@ -399,7 +399,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
       aio_comp->aio_type = io::AIO_TYPE_WRITE;
       auto req = io::ImageDispatchSpec::create_write(
         image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
-        std::move(bl), op_flags, trace, 0);
+        std::move(bl), op_flags, trace);
       req->send();
       return;
     } else if (prepend_length == 0 && append_length == 0) {
@@ -409,7 +409,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
 
       auto req = io::ImageDispatchSpec::create_write_same(
         image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
-        std::move(bl), op_flags, trace, 0);
+        std::move(bl), op_flags, trace);
       req->send();
       return;
     }
@@ -437,8 +437,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
         prepend_ctx, &image_ctx, io::AIO_TYPE_WRITE);
       auto prepend_req = io::ImageDispatchSpec::create_write(
         image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, prepend_aio_comp,
-        {{prepend_offset, prepend_length}}, std::move(bl), op_flags, trace,
-        0);
+        {{prepend_offset, prepend_length}}, std::move(bl), op_flags, trace);
       prepend_req->send();
     }
 
@@ -451,7 +450,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
         append_ctx, &image_ctx, io::AIO_TYPE_WRITE);
       auto append_req = io::ImageDispatchSpec::create_write(
         image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, append_aio_comp,
-        {{append_offset, append_length}}, std::move(bl), op_flags, trace, 0);
+        {{append_offset, append_length}}, std::move(bl), op_flags, trace);
       append_req->send();
     }
 
@@ -463,8 +462,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
       write_same_ctx, &image_ctx, io::AIO_TYPE_WRITESAME);
     auto req = io::ImageDispatchSpec::create_write_same(
       image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, write_same_aio_comp,
-      write_same_offset, write_same_length, std::move(bl), op_flags, trace,
-      0);
+      write_same_offset, write_same_length, std::move(bl), op_flags, trace);
     req->send();
     return;
   }
@@ -474,7 +472,7 @@ void Io<I>::aio_write_zeroes(I& image_ctx, io::AioCompletion *aio_comp,
 
   auto req = io::ImageDispatchSpec::create_discard(
     image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
-    discard_granularity_bytes, trace, 0);
+    discard_granularity_bytes, trace);
   req->send();
 }
 
@@ -508,7 +506,7 @@ void Io<I>::aio_compare_and_write(I &image_ctx, io::AioCompletion *aio_comp,
 
   auto req = io::ImageDispatchSpec::create_compare_and_write(
     image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
-    std::move(cmp_bl), std::move(bl), mismatch_off, op_flags, trace, 0);
+    std::move(cmp_bl), std::move(bl), mismatch_off, op_flags, trace);
   req->send();
 }
 
index 8b17b2591b2d6d592ea7c9bce3e0e44ddcf36aa7..da1bd2b6ebf2532a431cba875296a47b78ccd03a 100644 (file)
@@ -104,7 +104,7 @@ public:
   Request request;
   int op_flags;
   ZTracer::Trace parent_trace;
-  uint64_t tid;
+  uint64_t tid = 0;
 
   template <typename ImageCtxT = ImageCtx>
   static ImageDispatchSpec* create_read(
@@ -116,43 +116,40 @@ public:
                                  image_dispatch_layer, aio_comp,
                                  std::move(image_extents),
                                  Read{std::move(read_result)},
-                                 op_flags, parent_trace, 0);
+                                 op_flags, parent_trace);
   }
 
   template <typename ImageCtxT = ImageCtx>
   static ImageDispatchSpec* create_discard(
       ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
       AioCompletion *aio_comp, uint64_t off, uint64_t len,
-      uint32_t discard_granularity_bytes, const ZTracer::Trace &parent_trace,
-      uint64_t tid) {
+      uint32_t discard_granularity_bytes, const ZTracer::Trace &parent_trace) {
     return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
                                  image_dispatch_layer, aio_comp, {{off, len}},
                                  Discard{discard_granularity_bytes},
-                                 0, parent_trace, tid);
+                                 0, parent_trace);
   }
 
   template <typename ImageCtxT = ImageCtx>
   static ImageDispatchSpec* create_write(
       ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
       AioCompletion *aio_comp, Extents &&image_extents,
-      bufferlist &&bl, int op_flags, const ZTracer::Trace &parent_trace,
-      uint64_t tid) {
+      bufferlist &&bl, int op_flags, const ZTracer::Trace &parent_trace) {
     return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
                                  image_dispatch_layer, aio_comp,
                                  std::move(image_extents), Write{std::move(bl)},
-                                 op_flags, parent_trace, tid);
+                                 op_flags, parent_trace);
   }
 
   template <typename ImageCtxT = ImageCtx>
   static ImageDispatchSpec* create_write_same(
       ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
       AioCompletion *aio_comp, uint64_t off, uint64_t len,
-      bufferlist &&bl, int op_flags, const ZTracer::Trace &parent_trace,
-      uint64_t tid) {
+      bufferlist &&bl, int op_flags, const ZTracer::Trace &parent_trace) {
     return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
                                  image_dispatch_layer, aio_comp,
                                  {{off, len}}, WriteSame{std::move(bl)},
-                                 op_flags, parent_trace, tid);
+                                 op_flags, parent_trace);
   }
 
   template <typename ImageCtxT = ImageCtx>
@@ -160,14 +157,14 @@ public:
       ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
       AioCompletion *aio_comp, Extents &&image_extents,
       bufferlist &&cmp_bl, bufferlist &&bl, uint64_t *mismatch_offset,
-      int op_flags, const ZTracer::Trace &parent_trace, uint64_t tid) {
+      int op_flags, const ZTracer::Trace &parent_trace) {
     return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
                                  image_dispatch_layer, aio_comp,
                                  std::move(image_extents),
                                  CompareAndWrite{std::move(cmp_bl),
                                                  std::move(bl),
                                                  mismatch_offset},
-                                 op_flags, parent_trace, tid);
+                                 op_flags, parent_trace);
   }
 
   template <typename ImageCtxT = ImageCtx>
@@ -177,7 +174,7 @@ public:
       const ZTracer::Trace &parent_trace) {
     return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
                                  image_dispatch_layer, aio_comp, {},
-                                 Flush{flush_source}, 0, parent_trace, 0);
+                                 Flush{flush_source}, 0, parent_trace);
   }
 
   ~ImageDispatchSpec() {
@@ -196,11 +193,11 @@ private:
                     ImageDispatchLayer image_dispatch_layer,
                     AioCompletion* aio_comp, Extents&& image_extents,
                     Request&& request, int op_flags,
-                    const ZTracer::Trace& parent_trace, uint64_t tid)
+                    const ZTracer::Trace& parent_trace)
     : dispatcher_ctx(this), image_dispatcher(image_dispatcher),
       dispatch_layer(image_dispatch_layer), aio_comp(aio_comp),
       image_extents(std::move(image_extents)), request(std::move(request)),
-      op_flags(op_flags), parent_trace(parent_trace), tid(tid) {
+      op_flags(op_flags), parent_trace(parent_trace) {
     aio_comp->image_dispatcher_ctx = &dispatcher_ctx;
     aio_comp->get();
   }