Commit 74ad578f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/lustre: use 64-bit times for ksnd_connd

The connection starting/failing time stamps will overflow in 2038
on 32-bit machines, so we need to use time64_t and ktime_get_real_seconds()
instead.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05406826
...@@ -2426,7 +2426,7 @@ ksocknal_base_startup(void) ...@@ -2426,7 +2426,7 @@ ksocknal_base_startup(void)
ksocknal_data.ksnd_connd_starting = 0; ksocknal_data.ksnd_connd_starting = 0;
ksocknal_data.ksnd_connd_failed_stamp = 0; ksocknal_data.ksnd_connd_failed_stamp = 0;
ksocknal_data.ksnd_connd_starting_stamp = get_seconds(); ksocknal_data.ksnd_connd_starting_stamp = ktime_get_real_seconds();
/* must have at least 2 connds to remain responsive to accepts while /* must have at least 2 connds to remain responsive to accepts while
* connecting */ * connecting */
if (*ksocknal_tunables.ksnd_nconnds < SOCKNAL_CONND_RESV + 1) if (*ksocknal_tunables.ksnd_nconnds < SOCKNAL_CONND_RESV + 1)
......
...@@ -216,13 +216,13 @@ typedef struct { ...@@ -216,13 +216,13 @@ typedef struct {
wait_queue_head_t ksnd_connd_waitq; /* connds sleep here */ wait_queue_head_t ksnd_connd_waitq; /* connds sleep here */
int ksnd_connd_connecting; /* # connds connecting int ksnd_connd_connecting; /* # connds connecting
*/ */
long ksnd_connd_failed_stamp;/* time stamp of the time64_t ksnd_connd_failed_stamp;/* time stamp of the
* last failed * last failed
* connecting attempt */ * connecting attempt */
unsigned ksnd_connd_starting; /* # starting connd */ time64_t ksnd_connd_starting_stamp;/* time stamp of the
long ksnd_connd_starting_stamp;/* time stamp of the
* last starting connd * last starting connd
*/ */
unsigned ksnd_connd_starting; /* # starting connd */
unsigned ksnd_connd_running; /* # running connd */ unsigned ksnd_connd_running; /* # running connd */
spinlock_t ksnd_connd_lock; /* serialise */ spinlock_t ksnd_connd_lock; /* serialise */
......
...@@ -1998,7 +1998,7 @@ ksocknal_connect (ksock_route_t *route) ...@@ -1998,7 +1998,7 @@ ksocknal_connect (ksock_route_t *route)
* running out of resource. * running out of resource.
*/ */
static int static int
ksocknal_connd_check_start(long sec, long *timeout) ksocknal_connd_check_start(time64_t sec, long *timeout)
{ {
char name[16]; char name[16];
int rc; int rc;
...@@ -2048,7 +2048,7 @@ ksocknal_connd_check_start(long sec, long *timeout) ...@@ -2048,7 +2048,7 @@ ksocknal_connd_check_start(long sec, long *timeout)
/* we tried ... */ /* we tried ... */
LASSERT(ksocknal_data.ksnd_connd_starting > 0); LASSERT(ksocknal_data.ksnd_connd_starting > 0);
ksocknal_data.ksnd_connd_starting--; ksocknal_data.ksnd_connd_starting--;
ksocknal_data.ksnd_connd_failed_stamp = get_seconds(); ksocknal_data.ksnd_connd_failed_stamp = ktime_get_real_seconds();
return 1; return 1;
} }
...@@ -2060,7 +2060,7 @@ ksocknal_connd_check_start(long sec, long *timeout) ...@@ -2060,7 +2060,7 @@ ksocknal_connd_check_start(long sec, long *timeout)
* again to recheck these conditions. * again to recheck these conditions.
*/ */
static int static int
ksocknal_connd_check_stop(long sec, long *timeout) ksocknal_connd_check_stop(time64_t sec, long *timeout)
{ {
int val; int val;
...@@ -2141,7 +2141,7 @@ ksocknal_connd (void *arg) ...@@ -2141,7 +2141,7 @@ ksocknal_connd (void *arg)
while (!ksocknal_data.ksnd_shuttingdown) { while (!ksocknal_data.ksnd_shuttingdown) {
ksock_route_t *route = NULL; ksock_route_t *route = NULL;
long sec = get_seconds(); time64_t sec = ktime_get_real_seconds();
long timeout = MAX_SCHEDULE_TIMEOUT; long timeout = MAX_SCHEDULE_TIMEOUT;
int dropped_lock = 0; int dropped_lock = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment