]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: add swap, claim_append to ObjectModDesc
authorSamuel Just <sam.just@inktank.com>
Mon, 17 Feb 2014 05:26:41 +0000 (21:26 -0800)
committerSamuel Just <sam.just@inktank.com>
Tue, 18 Feb 2014 04:12:16 +0000 (20:12 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/osd_types.h

index 0b0ea65a740f0bdbb9a53be9c5a537fd85b2526e..732439cb941bbba711a15665cacb84038c27263a 100644 (file)
@@ -1772,6 +1772,27 @@ public:
     can_local_rollback = other.can_local_rollback;
     stashed = other.stashed;
   }
+  void claim_append(ObjectModDesc &other) {
+    if (!can_local_rollback || stashed)
+      return;
+    if (!other.can_local_rollback) {
+      mark_unrollbackable();
+      return;
+    }
+    bl.claim_append(other.bl);
+    stashed = other.stashed;
+  }
+  void swap(ObjectModDesc &other) {
+    bl.swap(other.bl);
+
+    bool temp = other.can_local_rollback;
+    other.can_local_rollback = can_local_rollback;
+    can_local_rollback = temp;
+
+    temp = other.stashed;
+    other.stashed = stashed;
+    stashed = temp;
+  }
   void append_id(ModID id) {
     uint8_t _id(id);
     ::encode(_id, bl);