]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: added equality operator to MirrorPeer journal types
authorJason Dillaman <dillaman@redhat.com>
Fri, 11 Mar 2016 02:41:40 +0000 (21:41 -0500)
committerJason Dillaman <dillaman@redhat.com>
Sun, 13 Mar 2016 03:40:16 +0000 (22:40 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/journal/Types.h

index 441e29d053c9b97601efbc016f46a8157fb69386..4139847133aa441b6ca56c2f1df80a3dac49013e 100644 (file)
@@ -339,6 +339,12 @@ struct MirrorPeerSyncPoint {
       object_number(object_number) {
   }
 
+  inline bool operator==(const MirrorPeerSyncPoint &sync) const {
+    return (snap_name == sync.snap_name &&
+            from_snap_name == sync.from_snap_name &&
+            object_number == sync.object_number);
+  }
+
   void encode(bufferlist& bl) const;
   void decode(__u8 version, bufferlist::iterator& it);
   void dump(Formatter *f) const;
@@ -362,6 +368,12 @@ struct MirrorPeerClientMeta {
     : image_id(image_id), sync_points(sync_points), snap_seqs(snap_seqs) {
   }
 
+  inline bool operator==(const MirrorPeerClientMeta &meta) const {
+    return (image_id == meta.image_id &&
+            sync_points == meta.sync_points &&
+            snap_seqs == meta.snap_seqs);
+  }
+
   void encode(bufferlist& bl) const;
   void decode(__u8 version, bufferlist::iterator& it);
   void dump(Formatter *f) const;