staging/lustre: use 64-bit time for ni_last_alive
authorArnd Bergmann <arnd@arndb.de>
Sun, 27 Sep 2015 20:45:22 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:03:37 +0000 (04:03 +0200)
The ni_last_alive member of lnet_ni uses a 'long' to store a timestamp,
which breaks on 32-bit systems in 2038.

This changes it to use time64_t and the respective functions for it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/lnet/lib-types.h
drivers/staging/lustre/lnet/lnet/config.c
drivers/staging/lustre/lnet/lnet/lib-move.c
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lnet/lnet/router_proc.c

index 81a63dbdea252d096132017e6bb3d1ce0b762b55..d792c4adb0ca4fbf56d45ec2221d17215167285f 100644 (file)
@@ -264,7 +264,7 @@ typedef struct lnet_ni {
        lnd_t                    *ni_lnd;       /* procedural interface */
        struct lnet_tx_queue    **ni_tx_queues; /* percpt TX queues */
        int                     **ni_refs;      /* percpt reference count */
-       long                      ni_last_alive;/* when I was last alive */
+       time64_t                  ni_last_alive;/* when I was last alive */
        lnet_ni_status_t         *ni_status;    /* my health status */
        /* equivalent interfaces to use */
        char                     *ni_interfaces[LNET_MAX_INTERFACES];
index 9c576ce2f455511c97dfda218586faa2d44df6de..b09a438c49d6243864b2c7857576d423932ed5cc 100644 (file)
@@ -166,7 +166,7 @@ lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist)
 
        /* LND will fill in the address part of the NID */
        ni->ni_nid = LNET_MKNID(net, 0);
-       ni->ni_last_alive = get_seconds();
+       ni->ni_last_alive = ktime_get_real_seconds();
        list_add_tail(&ni->ni_list, nilist);
        return ni;
  failed:
index 433faae9a2ff3b38a0d85dd0cc92ce9d679510f7..6badfec4c6a0f8fa13c3a5449907efa7506a3e8d 100644 (file)
@@ -1768,11 +1768,11 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid,
        }
 
        if (the_lnet.ln_routing &&
-           ni->ni_last_alive != get_seconds()) {
+           ni->ni_last_alive != ktime_get_real_seconds()) {
                lnet_ni_lock(ni);
 
                /* NB: so far here is the only place to set NI status to "up */
-               ni->ni_last_alive = get_seconds();
+               ni->ni_last_alive = ktime_get_real_seconds();
                if (ni->ni_status != NULL &&
                    ni->ni_status->ns_status == LNET_NI_STATUS_DOWN)
                        ni->ni_status->ns_status = LNET_NI_STATUS_UP;
index 2cdda3f0067efa709cfa2242b0ad2aab6979574f..0357b051401f528c23a30a9890300b49b79c500e 100644 (file)
@@ -789,7 +789,7 @@ static void
 lnet_update_ni_status_locked(void)
 {
        lnet_ni_t *ni;
-       long now;
+       time64_t now;
        int timeout;
 
        LASSERT(the_lnet.ln_routing);
@@ -797,7 +797,7 @@ lnet_update_ni_status_locked(void)
        timeout = router_ping_timeout +
                  max(live_router_check_interval, dead_router_check_interval);
 
-       now = get_seconds();
+       now = ktime_get_real_seconds();
        list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) {
                if (ni->ni_lnd->lnd_type == LOLND)
                        continue;
index a9f4cbf2fcfe8b7bc1c22e265e0df5f7c0209021..396c7c4e5c8392c7fac5c516c5028d6779c622f8 100644 (file)
@@ -692,7 +692,7 @@ static int proc_lnet_nis(struct ctl_table *table, int write,
                if (ni != NULL) {
                        struct lnet_tx_queue *tq;
                        char *stat;
-                       long now = get_seconds();
+                       time64_t now = ktime_get_real_seconds();
                        int last_alive = -1;
                        int i;
                        int j;