- cfs_duration_t duration = cfs_time_current() -
- scrub->os_time_last_checkpoint;
- __u64 new_checked = msecs_to_jiffies(scrub->os_new_checked *
- MSEC_PER_SEC);
- __u32 rtime = sf->sf_run_time +
- cfs_duration_sec(duration + HALF_SEC);
-
+ s64 new_checked = scrub->os_new_checked;
+ time64_t duration;
+ time64_t rtime;
+
+ /* Since the time resolution is in seconds for new system
+ * or small devices it ismore likely that duration will be
+ * zero which will lead to inaccurate results.
+ */
+ duration = ktime_get_seconds() -
+ scrub->os_time_last_checkpoint;