]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: use get_object_context in trim_object 1058/head
authorSage Weil <sage@inktank.com>
Mon, 13 Jan 2014 23:09:27 +0000 (15:09 -0800)
committerSage Weil <sage@inktank.com>
Tue, 14 Jan 2014 00:19:50 +0000 (16:19 -0800)
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>
src/osd/ReplicatedPG.cc

index 214f48c905e6fe87b3d3f5b69131da6feae26320..8ec8509217a943753607345d6cd471e1a5f27ca0 100644 (file)
@@ -2093,13 +2093,12 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid)
 {
   // 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());