dout(30) << __func__ << " " << oid << " " << o << dendl;
assert(onode_map.count(oid) == 0);
onode_map[oid] = o;
- cache->_add_onode(o);
+ cache->_add_onode(o, 1);
}
BlueStore::OnodeRef BlueStore::OnodeSpace::lookup(const ghobject_t& oid)
// install a non-existent onode at old location
oldo.reset(new Onode(this, old_oid, o->key));
po->second = oldo;
- cache->_add_onode(po->second);
+ cache->_add_onode(po->second, 1);
// add at new position and fix oid, key
onode_map.insert(make_pair(new_oid, o));
uint64_t buffer_size = 0;
public:
-
std::mutex lock; ///< protect lru and other structures
- void _add_onode(OnodeRef& o) {
- onode_lru.push_front(*o);
+ void _add_onode(OnodeRef& o, int level) {
+ if (level > 0)
+ onode_lru.push_front(*o);
+ else
+ onode_lru.push_back(*o);
}
void _rm_onode(OnodeRef& o) {
auto q = onode_lru.iterator_to(*o);