From: Sage Weil Date: Thu, 10 Mar 2016 19:25:25 +0000 (-0500) Subject: os/bluestore: ref ovec for CLONE, CLONERANGE X-Git-Tag: v10.1.0~113^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19e6b643f0158cfadbc858e412c5e3d27c041180;p=ceph.git os/bluestore: ref ovec for CLONE, CLONERANGE This keeps ovec up to date. Marginally more efficient. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2b8407a15ab3..2dcacdb7820a 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4450,7 +4450,10 @@ 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 = c->get_onode(noid, true); + OnodeRef& no = ovec[op->dest_oid]; + if (!no) { + no = c->get_onode(noid, true); + } r = _clone(txc, c, o, no); } break; @@ -4462,7 +4465,10 @@ 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 = c->get_onode(noid, true); + OnodeRef& no = ovec[op->dest_oid]; + if (!no) { + no = c->get_onode(noid, true); + } uint64_t srcoff = op->off; uint64_t len = op->len; uint64_t dstoff = op->dest_off;