summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-11 15:09:14 -0700
committerSage Weil <sage@inktank.com>2013-09-11 15:09:14 -0700
commitef7cffc34f3bad4ffc090361ad9030a47584a3bf (patch)
tree729cbf31cdea758e486f97fb56a6c04059b35384
parent661b377c28b5b94da17c644d8c501edb715176b0 (diff)
downloadceph-ef7cffc34f3bad4ffc090361ad9030a47584a3bf.tar.gz
os/ObjectStore: add collection_move_rename
Add method to move an object between collections *and* change its name. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/os/ObjectStore.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h
index 655afee004f..7e8f6ce43bf 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);