]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore: avoid unnecessary copy with coll_t 12576/head
authorYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Tue, 20 Dec 2016 01:52:30 +0000 (09:52 +0800)
committerYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Tue, 20 Dec 2016 01:52:30 +0000 (09:52 +0800)
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 2bcd2163e25fb6a30a2abb0f4dadc9cfef8c6b15..7e6b2941052a146d03175d4e4bc0a7299c3f16a6 100644 (file)
@@ -6993,7 +6993,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
     switch (op->op) {
     case Transaction::OP_RMCOLL:
       {
-        coll_t cid = i.get_cid(op->cid);
+        const coll_t &cid = i.get_cid(op->cid);
        r = _remove_collection(txc, cid, &c);
        if (!r)
          continue;
@@ -7003,7 +7003,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
     case Transaction::OP_MKCOLL:
       {
        assert(!c);
-       coll_t cid = i.get_cid(op->cid);
+       const coll_t &cid = i.get_cid(op->cid);
        r = _create_collection(txc, cid, op->split_bits, &c);
        if (!r)
          continue;
@@ -8836,7 +8836,7 @@ int BlueStore::_rename(TransContext *txc,
 
 int BlueStore::_create_collection(
   TransContext *txc,
-  coll_t cid,
+  const coll_t &cid,
   unsigned bits,
   CollectionRef *c)
 {
@@ -8867,7 +8867,7 @@ int BlueStore::_create_collection(
   return r;
 }
 
-int BlueStore::_remove_collection(TransContext *txc, coll_t cid,
+int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid,
                                  CollectionRef *c)
 {
   dout(15) << __func__ << " " << cid << dendl;
index b92777f5cd2be960eae691e38864e7ba15455c5d..2eeb4299c9aa4ce45d692f983234dcdc171c01e4 100644 (file)
@@ -2157,9 +2157,10 @@ private:
              OnodeRef& oldo,
              OnodeRef& newo,
              const ghobject_t& new_oid);
-  int _create_collection(TransContext *txc, coll_t cid, unsigned bits,
-                        CollectionRef *c);
-  int _remove_collection(TransContext *txc, coll_t cid, CollectionRef *c);
+  int _create_collection(TransContext *txc, const coll_t &cid,
+                        unsigned bits, CollectionRef *c);
+  int _remove_collection(TransContext *txc, const coll_t &cid,
+                         CollectionRef *c);
   int _split_collection(TransContext *txc,
                        CollectionRef& c,
                        CollectionRef& d,