From ae827cfe4d809ea50854c7230a3a80a2235d733b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sun, 16 Feb 2014 21:26:41 -0800 Subject: [PATCH] osd_types: add swap, claim_append to ObjectModDesc Signed-off-by: Samuel Just --- src/osd/osd_types.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 0b0ea65a740..732439cb941 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -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); -- 2.47.3