void BlueStore::OnodeSpace::rename(OnodeRef& oldo,
const ghobject_t& old_oid,
- const ghobject_t& new_oid)
+ const ghobject_t& new_oid,
+ const string& new_okey)
{
std::lock_guard<std::mutex> l(cache->lock);
dout(30) << __func__ << " " << old_oid << " -> " << new_oid << dendl;
onode_map.insert(make_pair(new_oid, o));
cache->_touch_onode(o);
o->oid = new_oid;
- get_object_key(new_oid, &o->key);
+ o->key = new_okey;
}
bool BlueStore::OnodeSpace::map_any(std::function<bool(OnodeRef)> f)
<< new_oid << dendl;
int r;
ghobject_t old_oid = oldo->oid;
+ string new_okey;
if (newo) {
if (newo->exists) {
// rewrite shards
oldo->extent_map.fault_range(db, 0, oldo->onode.size);
+ get_object_key(new_oid, &new_okey);
for (auto &s : oldo->extent_map.shards) {
txc->t->rmkey(PREFIX_OBJ, s.key);
- get_extent_shard_key(newo->key, s.offset, &s.key);
+ get_extent_shard_key(new_okey, s.offset, &s.key);
s.dirty = true;
}
// this adjusts oldo->{oid,key}, and reset oldo to a fresh empty
// Onode in the old slot
- c->onode_map.rename(oldo, old_oid, new_oid);
+ c->onode_map.rename(oldo, old_oid, new_oid, new_okey);
r = 0;
out:
void add(const ghobject_t& oid, OnodeRef o);
OnodeRef lookup(const ghobject_t& o);
void rename(OnodeRef& o, const ghobject_t& old_oid,
- const ghobject_t& new_oid);
+ const ghobject_t& new_oid,
+ const string& new_okey);
void clear();
/// return true if f true for any item