]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: fix clang compilation issues 44755/head
authorRonen Friedman <rfriedma@redhat.com>
Mon, 24 Jan 2022 13:01:49 +0000 (13:01 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 24 Jan 2022 18:22:44 +0000 (18:22 +0000)
Issues created by the scrub-backend refactoring PR.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine_lstnr.h

index 14f6a67e5201569958c2f4bccd50d13ed890704f..af1876badfadd5628ce88a39d18cb2c65f81eb4b 100644 (file)
@@ -2113,7 +2113,7 @@ PgScrubber::preemption_data_t::preemption_data_t(PG* pg) : m_pg{pg}
 
 void PgScrubber::preemption_data_t::reset()
 {
-  std::lock_guard<std::mutex> lk{m_preemption_lock};
+  std::lock_guard<ceph::mutex> lk{m_preemption_lock};
 
   m_preemptable = false;
   m_preempted = false;
index 313ab7be5cbfbf836be707317dd2a1cce3be3dfe..4263e24603eb2f3c34e41f8f8303093bd6b39924 100644 (file)
@@ -846,12 +846,15 @@ private:
 
     [[nodiscard]] bool is_preemptable() const final { return m_preemptable; }
 
+    preemption_data_t(const preemption_data_t&) = delete;
+    preemption_data_t(preemption_data_t&&) = delete;
+
     bool do_preempt() final
     {
       if (m_preempted || !m_preemptable)
        return false;
 
-      std::lock_guard<std::mutex> lk{m_preemption_lock};
+      std::lock_guard<ceph::mutex> lk{m_preemption_lock};
       if (!m_preemptable)
        return false;
 
@@ -865,7 +868,7 @@ private:
 
     void enable_preemption()
     {
-      std::lock_guard<std::mutex> lk{m_preemption_lock};
+      std::lock_guard<ceph::mutex> lk{m_preemption_lock};
       if (are_preemptions_left() && !m_preempted) {
        m_preemptable = true;
       }
@@ -881,7 +884,7 @@ private:
 
     bool disable_and_test() final
     {
-      std::lock_guard<std::mutex> lk{m_preemption_lock};
+      std::lock_guard<ceph::mutex> lk{m_preemption_lock};
       m_preemptable = false;
       return m_preempted;
     }
@@ -894,7 +897,7 @@ private:
 
     void adjust_parameters() final
     {
-      std::lock_guard<std::mutex> lk{m_preemption_lock};
+      std::lock_guard<ceph::mutex> lk{m_preemption_lock};
 
       if (m_preempted) {
        m_preempted = false;
@@ -906,7 +909,7 @@ private:
 
    private:
     PG* m_pg;
-    mutable ceph::mutex m_preemption_lock;
+    mutable ceph::mutex m_preemption_lock = ceph::make_mutex("preemption_lock");
     bool m_preemptable{false};
     bool m_preempted{false};
     int m_left;
index 2fed0a399f160519abcd14d7288cd5ec822009d2..942d5271e8c9bf156b5b5d80c3ab9e320fe741dd 100644 (file)
@@ -20,6 +20,10 @@ struct preemption_t {
 
   virtual ~preemption_t() = default;
 
+  preemption_t() = default;
+  preemption_t(const preemption_t&) = delete;
+  preemption_t(preemption_t&&) = delete;
+
   [[nodiscard]] virtual bool is_preemptable() const = 0;
 
   [[nodiscard]] virtual bool was_preempted() const = 0;