mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
Merge pull request #16117 from majianpeng/bluestore-move-object-exist-in-assign-nid
os/bluestore: move object exist in assign nid Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
1f47aff086
@ -7551,12 +7551,15 @@ int BlueStore::_upgrade_super()
|
||||
|
||||
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)
|
||||
@ -9156,7 +9159,6 @@ int BlueStore::_touch(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;
|
||||
@ -10278,7 +10280,6 @@ int BlueStore::_write(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_write(txc, c, o, offset, length, bl, fadvise_flags);
|
||||
txc->write_onode(o);
|
||||
@ -10297,7 +10298,6 @@ 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
|
||||
@ -10775,7 +10775,6 @@ int BlueStore::_clone(TransContext *txc,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
newo->exists = true;
|
||||
_assign_nid(txc, newo);
|
||||
|
||||
// clone data
|
||||
@ -10960,7 +10959,6 @@ int BlueStore::_clone_range(TransContext *txc,
|
||||
goto out;
|
||||
}
|
||||
|
||||
newo->exists = true;
|
||||
_assign_nid(txc, newo);
|
||||
|
||||
if (length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user