Skip to content
Commit 11dd2a97 authored by Tina Ruchandani's avatar Tina Ruchandani Committed by Greg Kroah-Hartman
Browse files

Staging: lustre: lnet: Improve 'incarnation' stamp



ksock_net_t uses a __u64 quantity as an 'incarnation' timestamp. This is also
passed on in hello messages and used to detect if a reboot has occurred.
This 'incarnation' is obtained using do_gettimeofday.It is only used in equality
checks, so the absolute value does not matter.

This patch replaces do_gettimeofday with ktime_get_ns for the following reasons:
1. ktime_get_ns returns a __u64 which is safer than 'struct timeval'
which will overflow on 32-bit systems in year 2038 and beyond.
2. Reduced compute: ktime_get_ns is faster than the multiply/add
   combination used in this function

Signed-off-by: default avatarTina Ruchandani <ruchandani.tina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b7c12ca4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment