Whamcloud - gitweb
LU-6496 ptlrpc: Fix wrong code indentation in plain_authorize
[fs/lustre-release.git] / lustre / ptlrpc / lproc_ptlrpc.c
index c937066..a86b460 100644 (file)
@@ -184,7 +184,7 @@ static const char *ll_eopcode2str(__u32 opcode)
         return ll_eopcode_table[opcode].opname;
 }
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
 static void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
                              char *name, struct proc_dir_entry **procroot_ret,
                              struct lprocfs_stats **stats_ret)
@@ -203,7 +203,7 @@ static void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
                 return;
 
         if (dir) {
-               svc_procroot = lprocfs_seq_register(dir, root, NULL, NULL);
+               svc_procroot = lprocfs_register(dir, root, NULL, NULL);
                 if (IS_ERR(svc_procroot)) {
                         lprocfs_free_stats(&svc_stats);
                         return;
@@ -942,27 +942,30 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
 
        rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi, srhi->srhi_seq);
 
-        if (rc == 0) {
-                req = srhi->srhi_req;
-
-                /* Print common req fields.
-                 * CAVEAT EMPTOR: we're racing with the service handler
-                 * here.  The request could contain any old crap, so you
-                 * must be just as careful as the service's request
-                 * parser. Currently I only print stuff here I know is OK
-                 * to look at coz it was set up in request_in_callback()!!! */
-                seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:%ld:%lds(%+lds) ",
-                           req->rq_history_seq, libcfs_nid2str(req->rq_self),
-                           libcfs_id2str(req->rq_peer), req->rq_xid,
-                           req->rq_reqlen, ptlrpc_rqphase2str(req),
-                           req->rq_arrival_time.tv_sec,
-                           req->rq_sent - req->rq_arrival_time.tv_sec,
-                           req->rq_sent - req->rq_deadline);
+       if (rc == 0) {
+               char nidstr[LNET_NIDSTR_SIZE];
+
+               req = srhi->srhi_req;
+
+               libcfs_nid2str_r(req->rq_self, nidstr, sizeof(nidstr));
+               /* Print common req fields.
+                * CAVEAT EMPTOR: we're racing with the service handler
+                * here.  The request could contain any old crap, so you
+                * must be just as careful as the service's request
+                * parser. Currently I only print stuff here I know is OK
+                * to look at coz it was set up in request_in_callback()!!! */
+               seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:%ld:%lds(%+lds) ",
+                          req->rq_history_seq, nidstr,
+                          libcfs_id2str(req->rq_peer), req->rq_xid,
+                          req->rq_reqlen, ptlrpc_rqphase2str(req),
+                          req->rq_arrival_time.tv_sec,
+                          req->rq_sent - req->rq_arrival_time.tv_sec,
+                          req->rq_sent - req->rq_deadline);
                if (svc->srv_ops.so_req_printer == NULL)
                        seq_printf(s, "\n");
                else
                        svc->srv_ops.so_req_printer(s, srhi->srhi_req);
-        }
+       }
 
        spin_unlock(&svcpt->scp_lock);
        return rc;
@@ -1020,7 +1023,7 @@ static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n)
                           DHMS_FMT" ago) ", "service",
                           cur, worst, worstt, DHMS_VARS(&ts));
 
-               lprocfs_seq_at_hist_helper(m, &svcpt->scp_at_estimate);
+               lprocfs_at_hist_helper(m, &svcpt->scp_at_estimate);
        }
 
        return 0;
@@ -1060,7 +1063,7 @@ LPROC_SEQ_FOPS(ptlrpc_lprocfs_hp_ratio);
 void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry,
                                      struct ptlrpc_service *svc)
 {
-       struct lprocfs_seq_vars lproc_vars[] = {
+       struct lprocfs_vars lproc_vars[] = {
                { .name = "high_priority_ratio",
                  .fops = &ptlrpc_lprocfs_hp_ratio_fops,
                  .data = svc },
@@ -1103,7 +1106,7 @@ void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry,
        if (svc->srv_procroot == NULL)
                return;
 
-       lprocfs_seq_add_vars(svc->srv_procroot, lproc_vars, NULL);
+       lprocfs_add_vars(svc->srv_procroot, lproc_vars, NULL);
 
        rc = lprocfs_seq_create(svc->srv_procroot, "req_history",
                                0400, &req_history_fops, svc);
@@ -1314,4 +1317,4 @@ lprocfs_pinger_recov_seq_write(struct file *file, const char *buffer,
 }
 EXPORT_SYMBOL(lprocfs_pinger_recov_seq_write);
 
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */