exists(true),
// size the shared blob hash table as a ratio of the onode cache size.
shared_blob_set(MAX(16,
- g_conf->bluestore_onode_cache_size *
+ g_conf->bluestore_onode_cache_size /
+ store->cache_shards.size() *
g_conf->bluestore_shared_blob_hash_table_size_ratio)),
onode_map(c)
{
return onode_map.add(oid, o);
}
+void BlueStore::Collection::trim_cache()
+{
+ cache->trim(
+ g_conf->bluestore_onode_cache_size / store->cache_shards.size(),
+ g_conf->bluestore_buffer_cache_size / store->cache_shards.size());
+}
+
// =======================================================
r = false;
}
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
-
+ c->trim_cache();
return r;
}
st->st_nlink = 1;
}
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
int r = 0;
if (_debug_mdata_eio(oid)) {
r = -EIO;
out:
assert(allow_eio || r != -EIO);
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
if (r == 0 && _debug_data_eio(oid)) {
r = -EIO;
derr << __func__ << " " << c->cid << " " << oid << " INJECT EIO" << dendl;
}
out:
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
::encode(m, bl);
dout(20) << __func__ << " 0x" << std::hex << offset << "~" << length
<< " size = 0x(" << m << ")" << std::dec << dendl;
r = 0;
}
out:
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
if (r == 0 && _debug_mdata_eio(oid)) {
r = -EIO;
derr << __func__ << " " << c->cid << " " << oid << " INJECT EIO" << dendl;
}
out:
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
if (r == 0 && _debug_mdata_eio(oid)) {
r = -EIO;
derr << __func__ << " " << c->cid << " " << oid << " INJECT EIO" << dendl;
}
out:
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
dout(10) << __func__ << " " << c->cid
<< " start " << start << " end " << end << " max " << max
<< " = " << r << ", ls.size() = " << ls->size()
}
if (c) {
- c->cache->trim(
- g_conf->bluestore_onode_cache_size,
- g_conf->bluestore_buffer_cache_size);
+ c->trim_cache();
}
}