#include <obd_class.h>
#include <lprocfs_status.h>
#include <lustre/lustre_idl.h>
+#include <lustre_nodemap.h>
#if defined(LPROCFS)
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);
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;
}
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;
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;
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);
}