find_object_context() has all the logic to choose a particular clone given
a logical snap. In the trim case, we want none of that: we just need to
pull the obc for a specific clone instance. Note that this changes
none of the failure cases (previous we asserted r == 0).
Signed-off-by: Sage Weil <sage@inktank.com>
{
// load clone info
bufferlist bl;
- ObjectContextRef obc;
- int r = find_object_context(coid, &obc, false, NULL);
- if (r == -ENOENT || coid.snap != obc->obs.oi.soid.snap) {
+ int r;
+ ObjectContextRef obc = get_object_context(coid, false, NULL);
+ if (!obc) {
derr << __func__ << "could not find coid " << coid << dendl;
assert(0);
}
- assert(r == 0);
object_info_t &coi = obc->obs.oi;
set<snapid_t> old_snaps(coi.snaps.begin(), coi.snaps.end());