]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: pass data into OpQueueItem::run()
authorSage Weil <sage@redhat.com>
Thu, 8 Feb 2018 19:36:41 +0000 (13:36 -0600)
committerSage Weil <sage@redhat.com>
Wed, 4 Apr 2018 13:26:52 +0000 (08:26 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OpQueueItem.cc
src/osd/OpQueueItem.h

index bdb9a0ed169f4584caf41073b81da609861164bc..e2128ae319a69053a7f157aa4d5c39a5b65d6534 100644 (file)
@@ -9720,7 +9720,7 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
       if (!qi.peering_requires_pg()) {
        // for pg-less events, we run them under the ordering lock, since
        // we don't have the pg lock to keep them ordered.
-       qi.run(osd, pg, tp_handle);
+       qi.run(osd, sdata, pg, tp_handle);
       } else if (osdmap->is_up_acting_osd_shard(token, osd->whoami)) {
        if (create_info) {
          if (create_info->by_mon &&
@@ -9819,7 +9819,7 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
   delete f;
   *_dout << dendl;
 
-  qi.run(osd, pg, tp_handle);
+  qi.run(osd, sdata, pg, tp_handle);
 
   {
 #ifdef WITH_LTTNG
index 6a0560d7c934ffc02bcaaa17b0593916337ffcd6..deb73ee522d8d3773bf5a77b7cad6499e7d79674 100644 (file)
 #include "OpQueueItem.h"
 #include "OSD.h"
 
-void PGOpItem::run(OSD *osd,
-                   PGRef& pg,
-                   ThreadPool::TPHandle &handle)
+void PGOpItem::run(
+  OSD *osd,
+  OSDShard *sdata,
+  PGRef& pg,
+  ThreadPool::TPHandle &handle)
 {
   osd->dequeue_op(pg, op, handle);
   pg->unlock();
@@ -25,31 +27,38 @@ void PGOpItem::run(OSD *osd,
 
 void PGPeeringItem::run(
   OSD *osd,
+  OSDShard *sdata,
   PGRef& pg,
   ThreadPool::TPHandle &handle)
 {
   osd->dequeue_peering_evt(pg.get(), evt, handle);
 }
 
-void PGSnapTrim::run(OSD *osd,
-                   PGRef& pg,
-                   ThreadPool::TPHandle &handle)
+void PGSnapTrim::run(
+  OSD *osd,
+  OSDShard *sdata,
+  PGRef& pg,
+  ThreadPool::TPHandle &handle)
 {
   pg->snap_trimmer(epoch_queued);
   pg->unlock();
 }
 
-void PGScrub::run(OSD *osd,
-                   PGRef& pg,
-                   ThreadPool::TPHandle &handle)
+void PGScrub::run(
+  OSD *osd,
+  OSDShard *sdata,
+  PGRef& pg,
+  ThreadPool::TPHandle &handle)
 {
   pg->scrub(epoch_queued, handle);
   pg->unlock();
 }
 
-void PGRecovery::run(OSD *osd,
-                   PGRef& pg,
-                   ThreadPool::TPHandle &handle)
+void PGRecovery::run(
+  OSD *osd,
+  OSDShard *sdata,
+  PGRef& pg,
+  ThreadPool::TPHandle &handle)
 {
   osd->do_recovery(pg.get(), epoch_queued, reserved_pushes, handle);
   pg->unlock();
@@ -57,6 +66,7 @@ void PGRecovery::run(OSD *osd,
 
 void PGRecoveryContext::run(
   OSD *osd,
+  OSDShard *sdata,
   PGRef& pg,
   ThreadPool::TPHandle &handle)
 {
@@ -66,6 +76,7 @@ void PGRecoveryContext::run(
 
 void PGDelete::run(
   OSD *osd,
+  OSDShard *sdata,
   PGRef& pg,
   ThreadPool::TPHandle &handle)
 {
index e981fc67338539ef105f63886dbe3876dda2b13b..faebf4a634a8ad479c0a34140e5ee4aa4e100bdf 100644 (file)
@@ -57,6 +57,7 @@
 #include "PGPeeringEvent.h"
 
 class OSD;
+class OSDShard;
 
 class OpQueueItem {
 public:
@@ -108,7 +109,7 @@ public:
 
     virtual ostream &print(ostream &rhs) const = 0;
 
-    virtual void run(OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) = 0;
+    virtual void run(OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) = 0;
     virtual ~OpQueueable() {}
     friend ostream& operator<<(ostream& out, const OpQueueable& q) {
       return q.print(out);
@@ -172,8 +173,8 @@ public:
   uint64_t get_reserved_pushes() const {
     return qitem->get_reserved_pushes();
   }
-  void run(OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) {
-    qitem->run(osd, pg, handle);
+  void run(OSD *osd, OSDShard *sdata,PGRef& pg, ThreadPool::TPHandle &handle) {
+    qitem->run(osd, sdata, pg, handle);
   }
   unsigned get_priority() const { return priority; }
   int get_cost() const { return cost; }
@@ -255,7 +256,7 @@ public:
   boost::optional<OpRequestRef> maybe_get_op() const override final {
     return op;
   }
-  void run(OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+  void run(OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };
 
 class PGPeeringItem : public PGOpQueueable {
@@ -268,7 +269,7 @@ public:
   ostream &print(ostream &rhs) const override final {
     return rhs << "PGPeeringEvent(" << evt->get_desc() << ")";
   }
-  void run(OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+  void run(OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
   bool is_peering() const override {
     return true;
   }
@@ -296,7 +297,7 @@ public:
               << ")";
   }
   void run(
-    OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+    OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };
 
 class PGScrub : public PGOpQueueable {
@@ -315,7 +316,7 @@ public:
               << ")";
   }
   void run(
-    OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+    OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };
 
 class PGRecovery : public PGOpQueueable {
@@ -342,7 +343,7 @@ public:
     return reserved_pushes;
   }
   virtual void run(
-    OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+    OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };
 
 class PGRecoveryContext : public PGOpQueueable {
@@ -362,7 +363,7 @@ public:
               << ")";
   }
   void run(
-    OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+    OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };
 
 class PGDelete : public PGOpQueueable {
@@ -382,5 +383,5 @@ public:
               << ")";
   }
   void run(
-    OSD *osd, PGRef& pg, ThreadPool::TPHandle &handle) override final;
+    OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) override final;
 };