/* Generic callbacks */
extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
extern int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data);
-extern int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data);
ssize_t conn_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf);
extern int lprocfs_import_seq_show(struct seq_file *m, void *data);
extern int lprocfs_state_seq_show(struct seq_file *m, void *data);
{ return 0; }
static inline int lprocfs_server_seq_show(struct seq_file *m, void *data)
{ return 0; }
-static inline int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
-{ return 0; }
static inline int lprocfs_import_seq_show(struct seq_file *m, void *data)
{ return 0; }
static inline int lprocfs_state_seq_show(struct seq_file *m, void *data)
}
LUSTRE_RW_ATTR(contention_seconds);
+LUSTRE_ATTR(mds_conn_uuid, 0444, conn_uuid_show, NULL);
LUSTRE_RO_ATTR(conn_uuid);
LUSTRE_WO_ATTR(ping);
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_mod_rpcs_in_flight.attr,
&lustre_attr_contention_seconds.attr,
+ &lustre_attr_mds_conn_uuid.attr,
&lustre_attr_conn_uuid.attr,
&lustre_attr_ping.attr,
NULL,
}
EXPORT_SYMBOL(lprocfs_server_uuid_seq_show);
-int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
-{
- struct obd_device *obd = data;
- struct ptlrpc_connection *conn;
- int rc = 0;
-
- LASSERT(obd != NULL);
-
- LPROCFS_CLIMP_CHECK(obd);
- conn = obd->u.cli.cl_import->imp_connection;
- if (conn && obd->u.cli.cl_import)
- seq_printf(m, "%s\n", conn->c_remote_uuid.uuid);
- else
- seq_printf(m, "%s\n", "<none>");
-
- LPROCFS_CLIMP_EXIT(obd);
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_conn_uuid_seq_show);
-
/** add up per-cpu counters */
/**
}
LUSTRE_RW_ATTR(max_dirty_mb);
+LUSTRE_ATTR(ost_conn_uuid, 0444, conn_uuid_show, NULL);
LUSTRE_RO_ATTR(conn_uuid);
LUSTRE_WO_ATTR(ping);
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_short_io_bytes.attr,
&lustre_attr_resend_count.attr,
+ &lustre_attr_ost_conn_uuid.attr,
&lustre_attr_conn_uuid.attr,
&lustre_attr_ping.attr,
&lustre_attr_idle_timeout.attr,
}
LUSTRE_RO_ATTR(ping);
+ssize_t osp_conn_uuid_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device,
+ dd_kobj);
+ struct lu_device *lu = dt2lu_dev(dt);
+ struct obd_device *obd = lu->ld_obd;
+ struct ptlrpc_connection *conn;
+ ssize_t count;
+
+ LPROCFS_CLIMP_CHECK(obd);
+ conn = obd->u.cli.cl_import->imp_connection;
+ if (conn && obd->u.cli.cl_import)
+ count = sprintf(buf, "%s\n", conn->c_remote_uuid.uuid);
+ else
+ count = sprintf(buf, "%s\n", "<none>");
+
+ LPROCFS_CLIMP_EXIT(obd);
+ return count;
+}
+
+LUSTRE_ATTR(ost_conn_uuid, 0444, osp_conn_uuid_show, NULL);
+LUSTRE_ATTR(mdt_conn_uuid, 0444, osp_conn_uuid_show, NULL);
+
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, connect_flags);
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, server_uuid);
-LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, conn_uuid);
-
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, timeouts);
LPROC_SEQ_FOPS_RW_TYPE(osp, import);
.fops = &osp_connect_flags_fops },
{ .name = "ost_server_uuid",
.fops = &osp_server_uuid_fops },
- { .name = "ost_conn_uuid",
- .fops = &osp_conn_uuid_fops },
{ .name = "timeouts",
.fops = &osp_timeouts_fops },
{ .name = "import",
.fops = &osp_connect_flags_fops },
{ .name = "mdt_server_uuid",
.fops = &osp_server_uuid_fops },
- { .name = "mdt_conn_uuid",
- .fops = &osp_conn_uuid_fops },
{ .name = "timeouts",
.fops = &osp_timeouts_fops },
{ .name = "import",
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_rpcs_in_progress.attr,
&lustre_attr_maxage.attr,
+ &lustre_attr_ost_conn_uuid.attr,
&lustre_attr_ping.attr,
&lustre_attr_prealloc_status.attr,
&lustre_attr_prealloc_next_id.attr,
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_rpcs_in_progress.attr,
&lustre_attr_maxage.attr,
+ &lustre_attr_mdt_conn_uuid.attr,
&lustre_attr_ping.attr,
&lustre_attr_prealloc_status.attr,
NULL,