return false;
}
-void BlueStore::ExtentMap::reshard(Onode *o)
+void BlueStore::ExtentMap::reshard(Onode *o, uint64_t min_alloc_size)
{
// un-span all blobs
auto p = spanning_blob_map.begin();
for (const auto& sh : shards) {
if (bstart < sh.offset && bend > sh.offset) {
uint32_t blob_offset = sh.offset - bstart;
- if (b->get_blob().can_split_at(blob_offset)) {
+ if (b->get_blob().can_split_at(blob_offset) &&
+ blob_offset % min_alloc_size == 0) {
dout(20) << __func__ << " splitting blob, bstart 0x"
<< std::hex << bstart
<< " blob_offset 0x" << blob_offset
t->rmkey(PREFIX_OBJ, s.key);
}
o->extent_map.fault_range(db, 0, o->onode.size);
- o->extent_map.reshard(o.get());
+ o->extent_map.reshard(o.get(), min_alloc_size);
reshard = o->extent_map.update(o.get(), t, true);
if (reshard) {
dout(20) << __func__ << " warning: still wants reshard, check options?"
BlobRef get_spanning_blob(int id);
bool update(Onode *on, KeyValueDB::Transaction t, bool force);
- void reshard(Onode *on);
+ void reshard(Onode *on, uint64_t min_alloc_size);
/// initialize Shards from the onode
void init_shards(Onode *on, bool loaded, bool dirty);