{
dout(10) << __func__ << " " << o->oid << " "
<< offset << "~" << length << dendl;
+ int changed = 0;
map<uint64_t,overlay_t>::iterator p =
o->onode.overlay_map.lower_bound(offset);
txc->t->rmkey(PREFIX_OVERLAY, key);
}
o->onode.overlay_map.erase(p++);
+ ++changed;
continue;
}
if (p->first >= offset) {
ov.value_offset += by;
ov.length -= by;
o->onode.overlay_map.erase(p++);
+ ++changed;
continue;
}
if (p->first < offset &&
<< dendl;
p->second.length = offset - p->first;
++p;
+ ++changed;
continue;
}
dout(20) << __func__ << " split " << p->first << " " << p->second
nov.length -= by;
o->onode.shared_overlays.insert(p->second.key);
++p;
+ ++changed;
}
- return 0;
+ return changed;
}
int NewStore::_do_overlay_write(TransContext *txc,
OnodeRef o = c->get_onode(oid, true);
_assign_nid(txc, o);
+ // overlay
+ if (_do_overlay_trim(txc, o, offset, length) > 0)
+ txc->write_onode(o);
+
if (o->onode.data_map.empty()) {
// we're already a big hole
if (offset + length > o->onode.size) {