]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: do not use WRITE_{EQ,CMP}_OPERATORS_2()
authorKefu Chai <tchaikov@gmail.com>
Wed, 3 Aug 2022 02:52:20 +0000 (10:52 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 3 Aug 2022 04:57:34 +0000 (12:57 +0800)
the default-generated comparison operators can fulfill our needs.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/os/seastore/backref/backref_tree_node.h
src/crimson/osd/scheduler/mclock_scheduler.h

index 2a29f94068ef99d3e59fdb642304dcfc362171ec..15f1d451b0715269212a899aec5cec6c6972adbf 100644 (file)
@@ -26,11 +26,11 @@ struct backref_map_val_t {
     laddr_t laddr,
     extent_types_t type)
     : len(len), laddr(laddr), type(type) {}
+
+  bool operator==(const backref_map_val_t& rhs) const noexcept {
+    return len == rhs.len && laddr == rhs.laddr;
+  }
 };
-WRITE_EQ_OPERATORS_2(
-  backref_map_val_t,
-  len,
-  laddr);
 
 std::ostream& operator<<(std::ostream &out, const backref_map_val_t& val);
 
index c3edbe7296c3a99cf87a06a6d24bf71d9af54774..153fc758bbd5f7fd50caf4e80b4ee0ab4ffbdca9 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "crimson/osd/scheduler/scheduler.h"
 #include "common/config.h"
-#include "include/cmp.h"
 #include "common/ceph_context.h"
 
 
@@ -37,20 +36,16 @@ using profile_id_t = uint64_t;
 struct client_profile_id_t {
   client_id_t client_id;
   profile_id_t profile_id;
+  auto operator<=>(const client_profile_id_t&) const = default;
 };
 
-WRITE_EQ_OPERATORS_2(client_profile_id_t, client_id, profile_id)
-WRITE_CMP_OPERATORS_2(client_profile_id_t, client_id, profile_id)
-
 
 struct scheduler_id_t {
   scheduler_class_t class_id;
   client_profile_id_t client_profile_id;
+  auto operator<=>(const scheduler_id_t&) const = default;
 };
 
-WRITE_EQ_OPERATORS_2(scheduler_id_t, class_id, client_profile_id)
-WRITE_CMP_OPERATORS_2(scheduler_id_t, class_id, client_profile_id)
-
 /**
  * Scheduler implementation based on mclock.
  *