Whamcloud - gitweb
LU-6070 libcfs: provide separate buffers for libcfs_*2str()
[fs/lustre-release.git] / lustre / mgs / lproc_mgs.c
index ae4cc39..2e4adf4 100644 (file)
@@ -43,7 +43,7 @@
 #include <lustre_param.h>
 #include "mgs_internal.h"
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
 
 static int mgs_fs_seq_show(struct seq_file *seq, void *v)
 {
@@ -90,16 +90,14 @@ static void seq_show_srpc_rules(struct seq_file *seq, const char *tgtname,
         struct sptlrpc_rule    *r;
         char                    dirbuf[10];
         char                    flvrbuf[40];
-        char                   *net;
+       char                    net[LNET_NIDSTR_SIZE] = "default";
         int                     i;
 
         for (i = 0; i < rset->srs_nrule; i++) {
                 r = &rset->srs_rules[i];
 
-                if (r->sr_netid == LNET_NIDNET(LNET_NID_ANY))
-                        net = "default";
-                else
-                        net = libcfs_net2str(r->sr_netid);
+               if (r->sr_netid != LNET_NIDNET(LNET_NID_ANY))
+                       libcfs_net2str_r(r->sr_netid, net, sizeof(net));
 
                 if (r->sr_from == LUSTRE_SP_ANY && r->sr_to == LUSTRE_SP_ANY)
                         dirbuf[0] = '\0';
@@ -207,7 +205,7 @@ LPROC_SEQ_FOPS_RO_TYPE(mgs, hash);
 LPROC_SEQ_FOPS_WO_TYPE(mgs, evict_client);
 LPROC_SEQ_FOPS_RW_TYPE(mgs, ir_timeout);
 
-static struct lprocfs_seq_vars lprocfs_mgs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mgs_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mgs_uuid_fops          },
        { .name =       "num_exports",
@@ -243,17 +241,17 @@ int lproc_mgs_setup(struct mgs_device *mgs, const char *osd_name)
        if (rc != 0)
                GOTO(out, rc);
 
-       mgs->mgs_proc_live = lprocfs_seq_register("live", obd->obd_proc_entry,
-                                                 NULL, NULL);
+       mgs->mgs_proc_live = lprocfs_register("live", obd->obd_proc_entry,
+                                             NULL, NULL);
         if (IS_ERR(mgs->mgs_proc_live)) {
                 rc = PTR_ERR(mgs->mgs_proc_live);
                 mgs->mgs_proc_live = NULL;
                GOTO(out, rc);
         }
 
-       obd->obd_proc_exports_entry = lprocfs_seq_register("exports",
-                                                          obd->obd_proc_entry,
-                                                          NULL, NULL);
+       obd->obd_proc_exports_entry = lprocfs_register("exports",
+                                                      obd->obd_proc_entry,
+                                                      NULL, NULL);
         if (IS_ERR(obd->obd_proc_exports_entry)) {
                 rc = PTR_ERR(obd->obd_proc_exports_entry);
                 obd->obd_proc_exports_entry = NULL;