]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: recalc pgid in case it wasn't a precalculated pgid
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 17 Apr 2012 07:14:19 +0000 (00:14 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 17 Apr 2012 07:14:19 +0000 (00:14 -0700)
We had an issue where we didn't call it since we relied on the
existance of the object name and we were passed an empty one.
However, we still need to handle the case of list_objects, where
we don't want to recalc pgid.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 24b95d2c8422e3db57b7c901ef674151f57cf272..acd4ef74e8086ba26160fbc27f197dee24fc1404 100644 (file)
@@ -974,7 +974,7 @@ int Objecter::recalc_op_target(Op *op)
 {
   vector<int> acting;
   pg_t pgid = op->pgid;
-  if (op->oid.name.length()) {
+  if (!op->precalc_pgid) {
     int ret = osdmap->object_locator_to_pg(op->oid, op->oloc, pgid);
     if (ret == -ENOENT)
       return RECALC_OP_TARGET_POOL_DNE;
@@ -1349,6 +1349,7 @@ void Objecter::list_objects(ListContext *list_context, Context *onfinish) {
   o->reply_epoch = &onack->epoch;
 
   o->pgid = pg_t(list_context->current_pg, list_context->pool_id, -1);
+  o->precalc_pgid = true;
 
   op_submit(o);
 }
index e733d3373e7c6345f9992220615a33c54641b752..d90e314d1e0de587eace94bc6279cfef11b5309c 100644 (file)
@@ -598,6 +598,8 @@ public:
 
     utime_t stamp;
 
+    bool precalc_pgid;
+
     Op(const object_t& o, const object_locator_t& ol, vector<OSDOp>& op,
        int f, Context *ac, Context *co, eversion_t *ov) :
       session(NULL), session_item(this), incarnation(0),
@@ -607,7 +609,7 @@ public:
       outbl(NULL),
       flags(f), priority(0), onack(ac), oncommit(co),
       tid(0), attempts(0),
-      paused(false), objver(ov), reply_epoch(NULL) {
+      paused(false), objver(ov), reply_epoch(NULL), precalc_pgid(false) {
       ops.swap(op);
       
       /* initialize out_* to match op vector */