From: Sage Weil Date: Wed, 27 Jan 2016 19:22:11 +0000 (-0500) Subject: Revert "BlueStore: fix nid overwritten of write/zero" X-Git-Tag: v10.0.4~101^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d7e21cb21732c2c672a075699ddca16fec0ec5d4;p=ceph.git Revert "BlueStore: fix nid overwritten of write/zero" This reverts commit fde0f0297aaf2f2717ec1b5a4c55295452817d0c. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 95e5bb56e3ef..b4062020879d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5270,11 +5270,8 @@ int BlueStore::_write(TransContext *txc, << " " << offset << "~" << length << dendl; RWLock::WLocker l(c->lock); - OnodeRef o = c->get_onode(oid, false); - if (!o) { - o = c->get_onode(oid, true); - _assign_nid(txc, o); - } + OnodeRef o = c->get_onode(oid, true); + _assign_nid(txc, o); int r = _do_write(txc, c, o, offset, length, bl, fadvise_flags); txc->write_onode(o); @@ -5310,13 +5307,9 @@ int BlueStore::_zero(TransContext *txc, RWLock::WLocker l(c->lock); EnodeRef enode; - OnodeRef o = c->get_onode(oid, false); - if (o) { - _dump_onode(o); - } else { - o = c->get_onode(oid, true); - _assign_nid(txc, o); - } + OnodeRef o = c->get_onode(oid, true); + _dump_onode(o); + _assign_nid(txc, o); // overlay _do_overlay_trim(txc, o, offset, length);