Skip to content

Commit

Permalink
common/TrackedOp: clean up code make look good.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit edefd05)
  • Loading branch information
majianpeng authored and dzafman committed Nov 15, 2016
1 parent f776699 commit ad488f6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/common/TrackedOp.cc
Expand Up @@ -155,20 +155,16 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &warning_vector)
utime_t now = ceph_clock_now(cct);
utime_t too_old = now;
too_old -= complaint_time;
utime_t oldest_op;
utime_t oldest_op = now;
uint64_t total_ops_in_flight = 0;
bool got_first_op = false;

for (uint32_t i = 0; i < num_optracker_shards; i++) {
ShardedTrackingData* sdata = sharded_in_flight_list[i];
assert(NULL != sdata);
Mutex::Locker locker(sdata->ops_in_flight_lock_sharded);
if (!sdata->ops_in_flight_sharded.empty()) {
utime_t oldest_op_tmp = sdata->ops_in_flight_sharded.front()->get_initiated();
if (!got_first_op) {
oldest_op = oldest_op_tmp;
got_first_op = true;
} else if (oldest_op_tmp < oldest_op) {
if (oldest_op_tmp < oldest_op) {
oldest_op = oldest_op_tmp;
}
}
Expand Down

0 comments on commit ad488f6

Please sign in to comment.