From: Sage Weil Date: Wed, 11 Sep 2013 22:09:14 +0000 (-0700) Subject: os/ObjectStore: add collection_move_rename X-Git-Tag: v0.71~119^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef7cffc34f3bad4ffc090361ad9030a47584a3bf;p=ceph.git os/ObjectStore: add collection_move_rename Add method to move an object between collections *and* change its name. Signed-off-by: Sage Weil --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 655afee004f3..7e8f6ce43bfc 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -159,6 +159,7 @@ public: OP_SPLIT_COLLECTION2 = 36, /* cid, bits, destination doesn't create the destination */ OP_OMAP_RMKEYRANGE = 37, // cid, oid, firstkey, lastkey + OP_COLL_MOVE_RENAME = 38, // oldcid, oldoid, newcid, newoid }; private: @@ -554,6 +555,15 @@ public: collection_remove(oldcid, oid); return; } + void collection_move_rename(coll_t oldcid, const hobject_t& oldoid, + coll_t cid, const hobject_t& oid) { + __u32 op = OP_COLL_MOVE_RENAME; + ::encode(op, tbl); + ::encode(oldcid, tbl); + ::encode(oldoid, tbl); + ::encode(cid, tbl); + ::encode(oid, tbl); + } void collection_setattr(coll_t cid, const char* name, bufferlist& val) { string n(name);