]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: normalize oloc.key
authorSage Weil <sage@newdream.net>
Wed, 5 Oct 2011 20:00:55 +0000 (13:00 -0700)
committerSage Weil <sage@newdream.net>
Wed, 5 Oct 2011 20:05:49 +0000 (13:05 -0700)
If oloc.key == oid, clear it.  Users can set it to the oid or leave it
blank; they are equivalent.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 6aa76046157f5818d2da7262c1bfc0d1de453a79..08e848b55d9a16790214075fb7270ee91c373fd2 100644 (file)
@@ -133,6 +133,8 @@ tid_t Objecter::linger(const object_t& oid, const object_locator_t& oloc,
   LingerOp *info = new LingerOp;
   info->oid = oid;
   info->oloc = oloc;
+  if (info->oloc.key == oid)
+    info->oloc.key.clear();
   info->snap = snap;
   info->flags = flags;
   info->ops = op.ops;
index b7873479952d8fa76be4f13fbe9ed2bbacbeb7f9..bf1d269bcba07c526bbf7a25b2d7d74559380ab5 100644 (file)
@@ -391,6 +391,9 @@ public:
       tid(0), attempts(0),
       paused(false), objver(ov), reply_epoch(NULL) {
       ops.swap(op);
+
+      if (oloc.key == o)
+       oloc.key.clear();
     }
 
     bool operator<(const Op& other) const {