X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosp%2Flproc_osp.c;h=530b34ec7a8128c246be255697551b46eb2b9158;hb=a633afc625197c853d3da2ec6bfca94de8bcd5ac;hp=1dd26b78a6c9f0222dc92e02b4f575d8219c25a0;hpb=c5e7e6f29afdb62915219a2cb2bfa09ff3db8034;p=fs%2Flustre-release.git diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c index 1dd26b7..530b34e 100644 --- a/lustre/osp/lproc_osp.c +++ b/lustre/osp/lproc_osp.c @@ -40,7 +40,7 @@ #include "osp_internal.h" -#ifdef LPROCFS +#ifdef CONFIG_PROC_FS /** * Show OSP active status * @@ -717,7 +717,7 @@ LPROC_SEQ_FOPS_RO_TYPE(osp, timeouts); LPROC_SEQ_FOPS_RW_TYPE(osp, import); LPROC_SEQ_FOPS_RO_TYPE(osp, state); -static struct lprocfs_seq_vars lprocfs_osp_obd_vars[] = { +static struct lprocfs_vars lprocfs_osp_obd_vars[] = { { .name = "uuid", .fops = &osp_uuid_fops }, { .name = "ping", @@ -773,7 +773,44 @@ static struct lprocfs_seq_vars lprocfs_osp_obd_vars[] = { .fops = &osp_destroys_in_flight_fops }, { .name = "lfsck_max_rpcs_in_flight", .fops = &osp_lfsck_max_rpcs_in_flight_fops }, - { 0 } + { NULL } +}; + +static struct lprocfs_vars lprocfs_osp_md_vars[] = { + { .name = "uuid", + .fops = &osp_uuid_fops }, + { .name = "ping", + .fops = &osp_ping_fops, + .proc_mode = 0222 }, + { .name = "connect_flags", + .fops = &osp_connect_flags_fops }, + { .name = "mdt_server_uuid", + .fops = &osp_server_uuid_fops }, + { .name = "mdt_conn_uuid", + .fops = &osp_conn_uuid_fops }, + { .name = "active", + .fops = &osp_active_fops }, + { .name = "max_rpcs_in_flight", + .fops = &osp_max_rpcs_in_flight_fops }, + { .name = "max_rpcs_in_progress", + .fops = &osp_max_rpcs_in_prog_fops }, + { .name = "timeouts", + .fops = &osp_timeouts_fops }, + { .name = "import", + .fops = &osp_import_fops }, + { .name = "state", + .fops = &osp_state_fops }, + { .name = "maxage", + .fops = &osp_maxage_fops }, + { .name = "prealloc_status", + .fops = &osp_pre_status_fops }, + + /* for compatibility reasons */ + { .name = "destroys_in_flight", + .fops = &osp_destroys_in_flight_fops }, + { .name = "lfsck_max_rpcs_in_flight", + .fops = &osp_lfsck_max_rpcs_in_flight_fops }, + { NULL } }; LPROC_SEQ_FOPS_RO_TYPE(osp, dt_blksize); @@ -783,7 +820,7 @@ LPROC_SEQ_FOPS_RO_TYPE(osp, dt_kbytesavail); LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filestotal); LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filesfree); -static struct lprocfs_seq_vars lprocfs_osp_osd_vars[] = { +static struct lprocfs_vars lprocfs_osp_osd_vars[] = { { .name = "blocksize", .fops = &osp_dt_blksize_fops }, { .name = "kbytestotal", @@ -796,7 +833,7 @@ static struct lprocfs_seq_vars lprocfs_osp_osd_vars[] = { .fops = &osp_dt_filestotal_fops }, { .name = "filesfree", .fops = &osp_dt_filesfree_fops }, - { 0 } + { NULL } }; /** @@ -811,18 +848,22 @@ void osp_lprocfs_init(struct osp_device *osp) struct obd_type *type; int rc; - obd->obd_vars = lprocfs_osp_obd_vars; + if (osp->opd_connect_mdt) + obd->obd_vars = lprocfs_osp_md_vars; + else + obd->obd_vars = lprocfs_osp_obd_vars; if (lprocfs_obd_setup(obd) != 0) return; - rc = lprocfs_seq_add_vars(obd->obd_proc_entry, lprocfs_osp_osd_vars, - &osp->opd_dt_dev); + rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_osp_osd_vars, + &osp->opd_dt_dev); if (rc) { CERROR("%s: can't register in lprocfs, rc %d\n", obd->obd_name, rc); return; } + sptlrpc_lprocfs_cliobd_attach(obd); ptlrpc_lprocfs_register_obd(obd); if (osp->opd_connect_mdt || !strstr(obd->obd_name, "osc")) @@ -848,5 +889,5 @@ void osp_lprocfs_init(struct osp_device *osp) obd->obd_name); } -#endif /* LPROCFS */ +#endif /* CONFIG_PROC_FS */