op->session->con->send_message(m);
}
-int Objecter::calc_op_budget(Op *op)
+int Objecter::calc_op_budget(const vector<OSDOp>& ops)
{
int op_budget = 0;
- for (vector<OSDOp>::iterator i = op->ops.begin();
- i != op->ops.end();
+ for (vector<OSDOp>::const_iterator i = ops.begin();
+ i != ops.end();
++i) {
if (i->op.op & CEPH_OSD_OP_MODE_WR) {
op_budget += i->indata.length();
bool locked_for_write = sul.owns_lock();
if (!op_budget)
- op_budget = calc_op_budget(op);
+ op_budget = calc_op_budget(op->ops);
if (!op_throttle_bytes.get_or_fail(op_budget)) { //couldn't take right now
sul.unlock();
op_throttle_bytes.get(op_budget);
* and returned whenever an op is removed from the map
* If throttle_op needs to throttle it will unlock client_lock.
*/
- int calc_op_budget(Op *op);
+ int calc_op_budget(const vector<OSDOp>& ops);
void _throttle_op(Op *op, shunique_lock& sul, int op_size = 0);
int _take_op_budget(Op *op, shunique_lock& sul) {
assert(sul && sul.mutex() == &rwlock);
- int op_budget = calc_op_budget(op);
+ int op_budget = calc_op_budget(op->ops);
if (keep_balanced_budget) {
_throttle_op(op, sul, op_budget);
} else {
}
void put_op_budget(Op *op) {
assert(op->budgeted);
- int op_budget = calc_op_budget(op);
+ int op_budget = calc_op_budget(op->ops);
put_op_budget_bytes(op_budget);
}
void put_nlist_context_budget(NListContext *list_context);