]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: "noid" is not always necessary in clone op 13769/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:27:33 +0000 (17:27 +0800)
Signed-off-by: wangzhengyong@cmss.chinamobile.com
src/os/bluestore/BlueStore.cc

index 151b0140300c8925cd9f06baa41ebfa66a8bca8d..89eeec8bf8b4c519bb0a56020d4f2adb05a7a2e1 100644 (file)
@@ -8092,9 +8092,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);
@@ -8107,9 +8107,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;