From: Sage Weil Date: Thu, 24 Sep 2009 21:56:39 +0000 (-0700) Subject: objecter: optionally set priority on ObjectOperations X-Git-Tag: v0.16~83 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=168edb8eba12a41bada0bf5289ae1b64182930ea;p=ceph.git objecter: optionally set priority on ObjectOperations This just sets the priority on the MOSDOp we send. --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index c34f5ef393407..93326633bbb80 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -435,6 +435,9 @@ tid_t Objecter::op_submit(Op *op) if (op->version != eversion_t()) m->set_version(op->version); // we're replaying this op! + if (op->priority) + m->set_priority(op->priority); + messenger->send_message(m, osdmap->get_inst(pg.primary())); } else maybe_request_map(); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index d3b54a99fa09c..80d55a6eef46f 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -45,6 +45,9 @@ class MStatfsReply; struct ObjectOperation { vector ops; int flags; + int priority; + + ObjectOperation() : flags(0), priority(0) {} void add_op(int op) { int s = ops.size(); @@ -163,8 +166,6 @@ struct ObjectOperation { void call(const char *cname, const char *method, bufferlist &indata) { add_call(CEPH_OSD_OP_CALL, cname, method, indata); } - - ObjectOperation() : flags(0) {} }; @@ -214,7 +215,7 @@ class Objecter { bufferlist inbl; bufferlist *outbl; - int flags; + int flags, priority; Context *onack, *oncommit; tid_t tid; @@ -226,7 +227,7 @@ class Objecter { Op(const object_t& o, ceph_object_layout& l, vector& op, int f, Context *ac, Context *co) : oid(o), layout(l), - snapid(CEPH_NOSNAP), outbl(0), flags(f), onack(ac), oncommit(co), + snapid(CEPH_NOSNAP), outbl(0), flags(f), priority(0), onack(ac), oncommit(co), tid(0), attempts(0), paused(false) { ops.swap(op); @@ -429,6 +430,7 @@ private: const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit) { Op *o = new Op(oid, ol, op.ops, flags, onack, oncommit); + o->priority = op.priority; o->mtime = mtime; o->snapc = snapc; return op_submit(o); @@ -438,6 +440,7 @@ private: snapid_t snapid, bufferlist *pbl, int flags, Context *onack) { Op *o = new Op(oid, ol, op.ops, flags, onack, NULL); + o->priority = op.priority; o->snapid = snapid; o->outbl = pbl; return op_submit(o);