Originally, we used do_div(a,b) to calculate the LFSCK average
speed, and got the result from the parameter @a. But later, we
replaced do_div(a,b) with div_u64(a,b). The latter one doesn't
stores the quotient in the parameter @a, instead, the quotient
is returned via the function return value. The patch fixes the
LFSCK logic to obtain the LFSCK average speed from div_u64(a,b)
return value.
Lustre-change: https://review.whamcloud.com/28617
Lustre-commit:
cf800c062c8c6424c442509139297095f8a708db
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I442fb8f7e6c51a4853ea37694e3c221f97e26b19
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/29294
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
cfs_duration_sec(duration + HALF_SEC);
if (duration != 0)
- do_div(new_checked, duration);
+ new_checked = div64_s64(new_checked, duration);
if (rtime != 0)
- do_div(speed, rtime);
+ speed = div64_s64(speed, rtime);
seq_printf(m, "checked_phase1: %llu\n"
"checked_phase2: %llu\n"
"run_time_phase1: %u seconds\n"
cfs_duration_sec(duration + HALF_SEC);
if (duration != 0)
- do_div(new_checked, duration);
+ new_checked = div64_s64(new_checked, duration);
if (lo->ll_run_time_phase1 != 0)
- do_div(speed1, lo->ll_run_time_phase1);
+ speed1 = div64_s64(speed1, lo->ll_run_time_phase1);
if (rtime != 0)
- do_div(speed2, rtime);
+ speed2 = div64_s64(speed2, rtime);
seq_printf(m, "checked_phase1: %llu\n"
"checked_phase2: %llu\n"
"run_time_phase1: %u seconds\n"
__u64 speed2 = lo->ll_objs_checked_phase2;
if (lo->ll_run_time_phase1 != 0)
- do_div(speed1, lo->ll_run_time_phase1);
+ speed1 = div64_s64(speed1, lo->ll_run_time_phase1);
if (lo->ll_run_time_phase2 != 0)
- do_div(speed2, lo->ll_run_time_phase2);
+ speed2 = div64_s64(speed2, lo->ll_run_time_phase2);
seq_printf(m, "checked_phase1: %llu\n"
"checked_phase2: %llu\n"
"run_time_phase1: %u seconds\n"
cfs_duration_sec(duration + HALF_SEC);
if (duration != 0)
- do_div(new_checked, duration);
+ new_checked = div64_s64(new_checked, duration);
if (rtime != 0)
- do_div(speed, rtime);
+ speed = div64_s64(speed, rtime);
lfsck_namespace_dump_statistics(m, ns, checked, 0, rtime, 0,
bk->lb_param & LPF_DRYRUN);
__u32 time0 = ns->ln_run_time_phase1 + rtime;
if (duration != 0)
- do_div(new_checked, duration);
+ new_checked = div64_s64(new_checked, duration);
if (ns->ln_run_time_phase1 != 0)
- do_div(speed1, ns->ln_run_time_phase1);
+ speed1 = div64_s64(speed1, ns->ln_run_time_phase1);
else if (ns->ln_items_checked != 0)
time0++;
if (rtime != 0)
- do_div(speed2, rtime);
+ speed2 = div64_s64(speed2, rtime);
else if (checked != 0)
time0++;
if (time0 != 0)
- do_div(speed0, time0);
+ speed0 = div64_s64(speed0, time0);
lfsck_namespace_dump_statistics(m, ns, ns->ln_items_checked,
checked,
__u32 time0 = ns->ln_run_time_phase1 + ns->ln_run_time_phase2;
if (ns->ln_run_time_phase1 != 0)
- do_div(speed1, ns->ln_run_time_phase1);
+ speed1 = div64_s64(speed1, ns->ln_run_time_phase1);
else if (ns->ln_items_checked != 0)
time0++;
if (ns->ln_run_time_phase2 != 0)
- do_div(speed2, ns->ln_run_time_phase2);
+ speed2 = div64_s64(speed2, ns->ln_run_time_phase2);
else if (ns->ln_objs_checked_phase2 != 0)
time0++;
if (time0 != 0)
- do_div(speed0, time0);
+ speed0 = div64_s64(speed0, time0);
lfsck_namespace_dump_statistics(m, ns, ns->ln_items_checked,
ns->ln_objs_checked_phase2,
[ $SPEED -lt $MAX_SPEED ] || {
$SHOW_LAYOUT
log "speed1: $BASE_SPEED1 time1: $RUN_TIME1"
- error_ignore LU-9887 "(4) Speed $SPEED, expected < $MAX_SPEED"
+ error "(4) Speed $SPEED, expected < $MAX_SPEED"
}
# adjust speed limit
$SHOW_LAYOUT
log "speed1: $BASE_SPEED1 time1: $RUN_TIME1"
log "speed2: $BASE_SPEED2 time2: $RUN_TIME2"
- error_ignore LU-9887 "(6) Speed $SPEED, expected < $MAX_SPEED"
+ error "(6) Speed $SPEED, expected < $MAX_SPEED"
}
do_facet $SINGLEMDS \
[ $SPEED -lt $MAX_SPEED ] || {
$SHOW_NAMESPACE
log "speed1: $BASE_SPEED1 time1: $RUN_TIME1"
- error_ignore LU-9887 "(8) Speed $SPEED, expected < $MAX_SPEED"
+ error "(8) Speed $SPEED, expected < $MAX_SPEED"
}
# adjust speed limit
$SHOW_NAMESPACE
log "speed1: $BASE_SPEED1 time1: $RUN_TIME1"
log "speed2: $BASE_SPEED2 time2: $RUN_TIME2"
- error_ignore LU-9887 "(10) Speed $SPEED, expected < $MAX_SPEED"
+ error "(10) Speed $SPEED, expected < $MAX_SPEED"
}
do_facet $SINGLEMDS \