From: Samuel Just Date: Mon, 17 Feb 2014 05:26:41 +0000 (-0800) Subject: osd_types: add swap, claim_append to ObjectModDesc X-Git-Tag: v0.78~163^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae827cfe4d809ea50854c7230a3a80a2235d733b;p=ceph.git osd_types: add swap, claim_append to ObjectModDesc Signed-off-by: Samuel Just --- diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 0b0ea65a740f..732439cb941b 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);