summaryrefslogtreecommitdiff
path: root/scripts/Lindent
diff options
context:
space:
mode:
authorTina Ruchandani <ruchandani.tina@gmail.com>2015-09-04 15:44:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 16:54:41 -0700
commit40476b8294466d40e7db57b4cbf69a831a4486b8 (patch)
treee1675104a4b34137ce7cf31c83b67672a08f4600 /scripts/Lindent
parentad694821224634d46b6571f0161e85ac2e397396 (diff)
downloadlinux-40476b8294466d40e7db57b4cbf69a831a4486b8.tar.gz
linux-40476b8294466d40e7db57b4cbf69a831a4486b8.tar.xz
ocfs2: use 64bit variables to track heartbeat time
o2hb_elapsed_msecs computes the time taken for a disk heartbeat. 'struct timeval' variables are used to store start and end times. On 32-bit systems, the 'tv_sec' component of 'struct timeval' will overflow in year 2038 and beyond. This patch solves the overflow with the following: 1. Replace o2hb_elapsed_msecs using 'ktime_t' values to measure start and end time, and built-in function 'ktime_ms_delta' to compute the elapsed time. ktime_get_real() is used since the code prints out the wallclock time. 2. Changes format string to print time as a single 64-bit nanoseconds value ("%lld") instead of seconds and microseconds. This simplifies the code since converting ktime_t to that format would need expensive computation. However, the debug log string is less readable than the previous format. Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com> Suggested by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/Lindent')
0 files changed, 0 insertions, 0 deletions