]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: "noid" is not always necessary in clone op 13715/head
authorwangzhengyong <wangzhengyong@cmss.chinamobile.com>
Fri, 3 Mar 2017 09:16:21 +0000 (17:16 +0800)
committerwangzhengyong <wangzhengyong@cmss.chinamobile.com>
Fri, 3 Mar 2017 09:16:21 +0000 (17:16 +0800)
Signed-off-by: wangzhengyong@cmss.chinamobile.com
src/os/bluestore/BlueStore.cc

index d5ff8d81c1f1c5740d6eaddd3634613571cf967a..f64346231712893613914508e4723e1fe1daa503 100644 (file)
@@ -8090,9 +8090,9 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
 
     case Transaction::OP_CLONE:
       {
-        const ghobject_t& noid = i.get_oid(op->dest_oid);
        OnodeRef& no = ovec[op->dest_oid];
        if (!no) {
+          const ghobject_t& noid = i.get_oid(op->dest_oid);
          no = c->get_onode(noid, true);
        }
        r = _clone(txc, c, o, no);
@@ -8105,9 +8105,9 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
 
     case Transaction::OP_CLONERANGE2:
       {
-       const ghobject_t& noid = i.get_oid(op->dest_oid);
        OnodeRef& no = ovec[op->dest_oid];
        if (!no) {
+         const ghobject_t& noid = i.get_oid(op->dest_oid);
          no = c->get_onode(noid, true);
        }
         uint64_t srcoff = op->off;