]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/ObjectStore: add collection_move_rename
authorSage Weil <sage@inktank.com>
Wed, 11 Sep 2013 22:09:14 +0000 (15:09 -0700)
committerSage Weil <sage@inktank.com>
Wed, 11 Sep 2013 22:09:14 +0000 (15:09 -0700)
Add method to move an object between collections *and* change its name.

Signed-off-by: Sage Weil <sage@inktank.com>
src/os/ObjectStore.h

index 655afee004f3b2754777c891d2d0801ebc998fad..7e8f6ce43bfca97c38709c60cb2b7ae91c7d5f35 100644 (file)
@@ -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);