Whamcloud - gitweb
LU-4536 tests: disable sanity test_65ic for ZFS
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status_server.c
index a4541cf..a47843e 100644 (file)
@@ -38,6 +38,7 @@
 #include <obd_class.h>
 #include <lprocfs_status.h>
 #include <lustre/lustre_idl.h>
+#include <lustre_nodemap.h>
 
 #if defined(LPROCFS)
 
@@ -160,8 +161,8 @@ int lprocfs_exp_nid_seq_show(struct seq_file *m, void *data)
        return seq_printf(m, "%s\n", obd_export_nid2str(exp));
 }
 
-int lprocfs_exp_print_uuid_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
-                               struct hlist_node *hnode, void *cb_data)
+static int lprocfs_exp_print_uuid_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+                                     struct hlist_node *hnode, void *cb_data)
 
 {
        struct obd_export *exp = cfs_hash_object(hs, hnode);
@@ -172,7 +173,17 @@ int lprocfs_exp_print_uuid_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
        return 0;
 }
 
-int lprocfs_exp_uuid_seq_show(struct seq_file *m, void *data)
+static int lprocfs_exp_nodemap_seq_show(struct seq_file *m, void *data)
+{
+       struct obd_export       *exp = m->private;
+       if (exp->exp_target_data.ted_nodemap)
+               return seq_printf(m, "%s\n",
+                                 exp->exp_target_data.ted_nodemap->nm_name);
+       return seq_printf(m, "null\n");
+}
+LPROC_SEQ_FOPS_RO(lprocfs_exp_nodemap);
+
+static int lprocfs_exp_uuid_seq_show(struct seq_file *m, void *data)
 {
        struct nid_stat *stats = m->private;
        struct obd_device *obd = stats->nid_obd;
@@ -183,8 +194,8 @@ int lprocfs_exp_uuid_seq_show(struct seq_file *m, void *data)
 }
 LPROC_SEQ_FOPS_RO(lprocfs_exp_uuid);
 
-int lprocfs_exp_print_hash_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
-                               struct hlist_node *hnode, void *cb_data)
+static int lprocfs_exp_print_hash_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+                                     struct hlist_node *hnode, void *cb_data)
 
 {
        struct seq_file *m = cb_data;
@@ -197,7 +208,7 @@ int lprocfs_exp_print_hash_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
        return 0;
 }
 
-int lprocfs_exp_hash_seq_show(struct seq_file *m, void *data)
+static int lprocfs_exp_hash_seq_show(struct seq_file *m, void *data)
 {
        struct nid_stat *stats = m->private;
        struct obd_device *obd = stats->nid_obd;
@@ -342,19 +353,27 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                GOTO(destroy_new_ns, rc);
        }
 
+       entry = lprocfs_add_simple(new_stat->nid_proc, "nodemap",
+                                  exp, &lprocfs_exp_nodemap_fops);
+       if (IS_ERR(entry)) {
+               rc = PTR_ERR(entry);
+               CWARN("Error adding the nodemap file: rc = %d\n", rc);
+               GOTO(destroy_new_ns, rc);
+       }
+
        entry = lprocfs_add_simple(new_stat->nid_proc, "uuid", new_stat,
                                   &lprocfs_exp_uuid_fops);
        if (IS_ERR(entry)) {
-               CWARN("Error adding the NID stats file\n");
                rc = PTR_ERR(entry);
+               CWARN("Error adding the NID stats file: rc = %d\n", rc);
                GOTO(destroy_new_ns, rc);
        }
 
        entry = lprocfs_add_simple(new_stat->nid_proc, "hash", new_stat,
                                   &lprocfs_exp_hash_fops);
        if (IS_ERR(entry)) {
-               CWARN("Error adding the hash file\n");
                rc = PTR_ERR(entry);
+               CWARN("Error adding the hash file: rc = %d\n", rc);
                GOTO(destroy_new_ns, rc);
        }