]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: optionally set priority on ObjectOperations
authorSage Weil <sage@newdream.net>
Thu, 24 Sep 2009 21:56:39 +0000 (14:56 -0700)
committerSage Weil <sage@newdream.net>
Thu, 24 Sep 2009 21:56:39 +0000 (14:56 -0700)
This just sets the priority on the MOSDOp we send.

src/osdc/Objecter.cc
src/osdc/Objecter.h

index c34f5ef3934074ffecb588dc1c74d3c6184e70b9..93326633bbb804616e0cbeea730cc81be6d4d52d 100644 (file)
@@ -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();
index d3b54a99fa09c4c168cd9b56c262843d0208805c..80d55a6eef46fcca0b3c058d47e7c1ae4a659d74 100644 (file)
@@ -45,6 +45,9 @@ class MStatfsReply;
 struct ObjectOperation {
   vector<OSDOp> 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<OSDOp>& 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);