]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: implement operator<.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 11 May 2011 23:52:24 +0000 (16:52 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 11 May 2011 23:52:24 +0000 (16:52 -0700)
This will maintain ordering of Ops when they're in eg STL sets.
Previously Objecter::handle_osd_map would indiscriminately fire out
Op replays in an order determined by their pointer address! Obviously,
this could cause breakage.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/osdc/Objecter.h

index 020edbaf17cbb24f2f0462c55ad45ebeef616c08..819bcc76483d4f31df4ba43f0f77e3679b46c484 100644 (file)
@@ -323,6 +323,10 @@ public:
       paused(false), objver(ov) {
       ops.swap(op);
     }
+
+    bool operator<(const Op& other) const {
+      return tid < other.tid;
+    }
   };
 
   struct C_Stat : public Context {