void BlueStore::_assign_nid(TransContext *txc, OnodeRef o)
{
- if (o->onode.nid)
+ if (o->onode.nid) {
+ assert(o->exists);
return;
+ }
uint64_t nid = ++nid_last;
dout(20) << __func__ << " " << nid << dendl;
o->onode.nid = nid;
txc->last_nid = nid;
+ o->exists = true;
}
uint64_t BlueStore::_assign_blobid(TransContext *txc)
{
dout(15) << __func__ << " " << c->cid << " " << o->oid << dendl;
int r = 0;
- o->exists = true;
_assign_nid(txc, o);
txc->write_onode(o);
dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl;
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_write(txc, c, o, offset, length, bl, fadvise_flags);
txc->write_onode(o);
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
return -EINVAL;
}
- newo->exists = true;
_assign_nid(txc, newo);
// clone data
goto out;
}
- newo->exists = true;
_assign_nid(txc, newo);
if (length > 0) {