objecter: normalize oloc.key

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>
This commit is contained in:
Sage Weil 2011-10-05 13:00:55 -07:00
parent a3316f4479
commit c4b51e30bb
2 changed files with 5 additions and 0 deletions

View 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;

View 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 {