#ifdef CONFIG_PROC_FS
-LPROC_SEQ_FOPS_RO_TYPE(mgc, connect_flags);
-LPROC_SEQ_FOPS_RO_TYPE(mgc, server_uuid);
-LPROC_SEQ_FOPS_RO_TYPE(mgc, conn_uuid);
-LPROC_SEQ_FOPS_RO_TYPE(mgc, import);
-LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mgc, connect_flags);
-LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mgc, server_uuid);
+
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mgc, import);
+
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mgc, state);
static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
{
return lprocfs_mgc_rd_ir_state(m, m->private);
}
-LPROC_SEQ_FOPS_RO(mgc_ir_state);
+
+LDEBUGFS_SEQ_FOPS_RO(mgc_ir_state);
struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
- { .name = "ping",
- .fops = &mgc_ping_fops,
- .proc_mode = 0222 },
{ .name = "connect_flags",
.fops = &mgc_connect_flags_fops },
{ .name = "mgs_server_uuid",
.fops = &mgc_server_uuid_fops },
- { .name = "mgs_conn_uuid",
- .fops = &mgc_conn_uuid_fops },
{ .name = "import",
.fops = &mgc_import_fops },
{ .name = "state",
{ NULL }
};
#endif /* CONFIG_PROC_FS */
+
+LUSTRE_RO_ATTR(conn_uuid);
+LUSTRE_WO_ATTR(ping);
+
+static struct attribute *mgc_attrs[] = {
+ &lustre_attr_conn_uuid.attr,
+ &lustre_attr_ping.attr,
+ NULL,
+};
+
+int mgc_tunables_init(struct obd_device *obd)
+{
+ int rc;
+
+ obd->obd_ktype.default_attrs = mgc_attrs;
+ obd->obd_vars = lprocfs_mgc_obd_vars;
+ rc = lprocfs_obd_setup(obd, true);
+ if (rc)
+ return rc;
+
+ return sptlrpc_lprocfs_cliobd_attach(obd);
+}
RETURN(rc);
}
-#ifdef CONFIG_PROC_FS
int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
{
struct obd_device *obd = data;
struct obd_import *imp;
struct obd_connect_data *ocd;
struct config_llog_data *cld;
- ENTRY;
- LASSERT(obd != NULL);
+ ENTRY;
+ LASSERT(obd);
LPROCFS_CLIMP_CHECK(obd);
imp = obd->u.cli.cl_import;
ocd = &imp->imp_connect_data;
LPROCFS_CLIMP_EXIT(obd);
RETURN(0);
}
-#endif
/* reenqueue any lost locks */
#define RQ_RUNNING 0x1
GOTO(err_cleanup, rc);
}
-#ifdef CONFIG_PROC_FS
- obd->obd_vars = lprocfs_mgc_obd_vars;
- lprocfs_obd_setup(obd, true);
-#endif
- sptlrpc_lprocfs_cliobd_attach(obd);
+ rc = mgc_tunables_init(obd);
+ if (rc)
+ GOTO(err_sysfs, rc);
if (atomic_inc_return(&mgc_count) == 1) {
rq_state = 0;
CERROR("%s: cannot start requeue thread: rc = %d; "
"no more log updates\n",
obd->obd_name, rc);
- GOTO(err_cleanup, rc);
+ GOTO(err_sysfs, rc);
}
/* rc is the task_struct pointer of mgc_requeue_thread. */
rc = 0;
RETURN(rc);
+err_sysfs:
+ lprocfs_obd_cleanup(obd);
err_cleanup:
client_obd_cleanup(obd);
err_decref:
static int __init mgc_init(void)
{
- return class_register_type(&mgc_obd_ops, NULL, true, NULL,
+ return class_register_type(&mgc_obd_ops, NULL, false, NULL,
LUSTRE_MGC_NAME, NULL);
}