Whamcloud - gitweb
LU-5570 lnet: check router aliveness timestamp
[fs/lustre-release.git] / lnet / lnet / router_proc.c
index edbc0ec..95d34c9 100644 (file)
@@ -80,7 +80,7 @@ static struct ctl_table_header *lnet_table_header = NULL;
 #define LNET_PROC_VERSION(v)   ((unsigned int)((v) & LNET_PROC_VER_MASK))
 
 static int __proc_lnet_stats(void *data, int write,
-                             loff_t pos, void *buffer, int nob)
+                            loff_t pos, void __user *buffer, int nob)
 {
         int              rc;
         lnet_counters_t *ctrs;
@@ -507,14 +507,11 @@ proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer,
                         int        minrtrcr  = peer->lp_minrtrcredits;
                         int        txqnob    = peer->lp_txqnob;
 
-                        if (lnet_isrouter(peer) ||
-                            lnet_peer_aliveness_enabled(peer))
-                                aliveness = peer->lp_alive ? "up" : "down";
-
                         if (lnet_peer_aliveness_enabled(peer)) {
-                                cfs_time_t     now = cfs_time_current();
-                                cfs_duration_t delta;
+                               cfs_time_t     now = cfs_time_current();
+                               cfs_duration_t delta;
 
+                               aliveness = peer->lp_alive ? "up" : "down";
                                 delta = cfs_time_sub(now, peer->lp_last_alive);
                                 lastalive = cfs_duration_sec(delta);
 
@@ -568,7 +565,7 @@ proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer,
 }
 
 static int __proc_lnet_buffers(void *data, int write,
-                               loff_t pos, void *buffer, int nob)
+                              loff_t pos, void __user *buffer, int nob)
 {
        char            *s;
        char            *tmpstr;
@@ -793,7 +790,7 @@ static struct lnet_portal_rotors    portal_rotors[] = {
 extern int portal_rotor;
 
 static int __proc_lnet_portal_rotor(void *data, int write,
-                                   loff_t pos, void *buffer, int nob)
+                                   loff_t pos, void __user *buffer, int nob)
 {
        const int       buf_len = 128;
        char            *buf;
@@ -840,8 +837,8 @@ static int __proc_lnet_portal_rotor(void *data, int write,
        rc = -EINVAL;
        lnet_res_lock(0);
        for (i = 0; portal_rotors[i].pr_name != NULL; i++) {
-               if (cfs_strncasecmp(portal_rotors[i].pr_name, tmp,
-                                   strlen(portal_rotors[i].pr_name)) == 0) {
+               if (strncasecmp(portal_rotors[i].pr_name, tmp,
+                               strlen(portal_rotors[i].pr_name)) == 0) {
                        portal_rotor = portal_rotors[i].pr_value;
                        rc = 0;
                        break;