]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: move nid assignment into BlueStore::_zero()
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 26 Sep 2016 03:00:41 +0000 (11:00 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 28 Sep 2016 00:32:37 +0000 (08:32 +0800)
So other callers, such as BlueStore::_clone_range(),
won't do it twice.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index 627ee25fdc8dc978fde2866dd6819e43bb381d8d..c70ef8cd8a7a6398afc6698b0f07639881dc9df1 100644 (file)
@@ -7581,6 +7581,8 @@ int BlueStore::_zero(TransContext *txc,
   dout(15) << __func__ << " " << c->cid << " " << o->oid
           << " 0x" << std::hex << offset << "~" << length << std::dec
           << dendl;
+  o->exists = true;
+  _assign_nid(txc, o);
   int r = _do_zero(txc, c, o, offset, length);
   dout(10) << __func__ << " " << c->cid << " " << o->oid
           << " 0x" << std::hex << offset << "~" << length << std::dec
@@ -7597,8 +7599,6 @@ int BlueStore::_do_zero(TransContext *txc,
           << " 0x" << std::hex << offset << "~" << length << std::dec
           << dendl;
   int r = 0;
-  o->exists = true;
-  _assign_nid(txc, o);
 
   _dump_onode(o);