r = -ENOENT;
goto out;
}
-
- newo = c->get_onode(new_oid, false);
- if (newo) {
- r = _do_truncate(txc, c, newo, 0);
- if (r < 0)
- goto out;
- } else {
- newo = c->get_onode(new_oid, true);
- _assign_nid(txc, newo);
- }
+ newo = c->get_onode(new_oid, true);
assert(newo);
newo->exists = true;
+ _assign_nid(txc, newo);
// data
oldo->flush();
+ r = _do_truncate(txc, c, newo, 0);
+ if (r < 0)
+ goto out;
+
if (g_conf->bluestore_clone_cow) {
EnodeRef e = c->get_enode(newo->oid.hobj.get_hash());
bool marked = false;