no need to compute the cost a second time
Signed-off-by: runsisi <runsisi@zte.com.cn>
spg_t pgid;
epoch_t map_epoch;
vector<PushOp> pushes;
+
+private:
uint64_t cost;
+public:
void compute_cost(CephContext *cct) {
cost = 0;
for (vector<PushOp>::iterator i = pushes.begin();
return cost;
}
+ void set_cost(uint64_t c) {
+ cost = c;
+ }
+
MOSDPGPush() :
Message(MSG_OSD_PG_PUSH, HEAD_VERSION, COMPAT_VERSION),
cost(0)
pushes += 1;
msg->pushes.push_back(*j);
}
- msg->compute_cost(cct);
+ msg->set_cost(cost);
get_parent()->send_message_osd_cluster(msg, con);
}
}