]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote-tracking branch 'guangyy/wip-9008' into giant
authorSamuel Just <sam.just@inktank.com>
Tue, 7 Oct 2014 18:42:14 +0000 (11:42 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 7 Oct 2014 18:42:14 +0000 (11:42 -0700)
1  2 
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 5f2e15eae810fd181b5813efe4659cb76b840c08,7af51e3d268c3bddf670958163f276391713bb03..a2c4ddb33d2d551cceecb564be05f4fe4569179c
@@@ -1689,19 -1684,23 +1689,26 @@@ ceph_tid_t Objecter::_op_submit_with_bu
    assert(op->ops.size() == op->out_rval.size());
    assert(op->ops.size() == op->out_handler.size());
  
 -  if (osd_timeout > 0) {
 -    op->ontimeout = new C_CancelOp(op, this);
 -    timer.add_event_after(osd_timeout, op->ontimeout);
 -  }
 -
    // throttle.  before we look at any state, because
    // take_op_budget() may drop our lock while it blocks.
-   _take_op_budget(op);
+   if (!op->ctx_budgeted || (ctx_budget && (*ctx_budget == -1))) {
+     int op_budget = _take_op_budget(op);
+     // take and pass out the budget for the first OP
+     // in the context session
+     if (ctx_budget && (*ctx_budget == -1)) {
+       *ctx_budget = op_budget;
+     }
+   }
  
 -  return _op_submit(op, lc);
 +  ceph_tid_t tid = _op_submit(op, lc);
 +
 +  if (osd_timeout > 0) {
 +    Mutex::Locker l(timer_lock);
 +    op->ontimeout = new C_CancelOp(tid, this);
 +    timer.add_event_after(osd_timeout, op->ontimeout);
 +  }
 +
 +  return tid;
  }
  
  ceph_tid_t Objecter::_op_submit(Op *op, RWLock::Context& lc)
@@@ -2295,14 -2294,9 +2302,14 @@@ void Objecter::_finish_op(Op *op
  
    assert(op->session->lock.is_wlocked());
  
-   if (op->budgeted)
+   if (!op->ctx_budgeted && op->budgeted)
      put_op_budget(op);
  
 +  if (op->ontimeout) {
 +    Mutex::Locker l(timer_lock);
 +    timer.cancel_event(op->ontimeout);
 +  }
 +
    _session_op_remove(op->session, op);
  
    logger->dec(l_osdc_op_active);
Simple merge