}
ldlm_register_intent(obd->obd_namespace, mds_intent_policy);
+ lprocfs_init_vars(mds, &lvars);
+ if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
+ lprocfs_alloc_obd_stats(obd, LPROC_MDS_LAST) == 0) {
+ /* Init private stats here */
+ mds_stats_counter_init(obd->obd_stats);
+ obd->obd_proc_exports = proc_mkdir("exports",
+ obd->obd_proc_entry);
+ }
+
rc = mds_fs_setup(obd, mnt);
if (rc) {
CERROR("%s: MDS filesystem method init failed: rc = %d\n",
if (rc)
GOTO(err_qctxt, rc);
- lprocfs_init_vars(mds, &lvars);
- if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
- lprocfs_alloc_obd_stats(obd, LPROC_MDS_LAST) == 0) {
- /* Init private stats here */
- mds_stats_counter_init(obd->obd_stats);
- obd->obd_proc_exports = proc_mkdir("exports",
- obd->obd_proc_entry);
- }
-
uuid_ptr = fsfilt_uuid(obd, obd->u.obt.obt_sb);
if (uuid_ptr != NULL) {
class_uuid_unparse(uuid_ptr, &uuid);
if (!page)
RETURN(-ENOMEM);
- memcpy((void *)page, lustre_cfg_buf(lcfg, 4),
- LUSTRE_CFG_BUFLEN(lcfg, 4));
- rc = filter_common_setup(obd, len, buf, (void *)page);
- free_page(page);
-
+ /* lprocfs must be setup before the filter so state can be safely added
+ * to /proc incrementally as the filter is setup */
lprocfs_init_vars(filter, &lvars);
- if (rc == 0 && lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
+ if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
lprocfs_alloc_obd_stats(obd, LPROC_FILTER_LAST) == 0) {
/* Init obdfilter private stats here */
lprocfs_counter_init(obd->obd_stats, LPROC_FILTER_READ_BYTES,
obd->obd_proc_entry);
}
+ memcpy((void *)page, lustre_cfg_buf(lcfg, 4),
+ LUSTRE_CFG_BUFLEN(lcfg, 4));
+ rc = filter_common_setup(obd, len, buf, (void *)page);
+ free_page(page);
+
+ if (rc) {
+ lprocfs_obd_cleanup(obd);
+ lprocfs_free_obd_stats(obd);
+ }
+
return rc;
}
lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_W_PAGES],
nr_pages);
- lprocfs_oh_tally_log2(&fed->fed_brw_stats.hist[BRW_W_PAGES],
- nr_pages);
+ lprocfs_oh_tally_log2(&fed->fed_brw_stats.hist[BRW_W_PAGES], nr_pages);
while (nr_pages-- > 0) {
if (last_page && (*pages)->index != (last_page->index + 1))
int nr_pages, unsigned long *blocks, int blocks_per_page)
{
struct filter_obd *filter = &exp->exp_obd->u.filter;
+ struct filter_export_data *fed = &exp->exp_filter_data;
struct page *last_page = NULL;
unsigned long *last_block = NULL;
unsigned long discont_pages = 0;
if (nr_pages == 0)
return;
- lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_PAGES], nr_pages);
+ lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_PAGES],
+ nr_pages);
+ lprocfs_oh_tally_log2(&fed->fed_brw_stats.hist[BRW_R_PAGES], nr_pages);
while (nr_pages-- > 0) {
if (last_page && (*pages)->index != (last_page->index + 1))
}
}
- lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_PAGES], nr_pages);
- lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_PAGES], discont_pages);
- lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_BLOCKS], discont_blocks);
+ lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_PAGES],
+ discont_pages);
+ lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_BLOCKS],
+ discont_blocks);
- lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_PAGES],
- nr_pages);
- lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DISCONT_PAGES],
+ lprocfs_oh_tally(&fed->fed_brw_stats.hist[BRW_R_DISCONT_PAGES],
discont_pages);
- lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DISCONT_BLOCKS],
+ lprocfs_oh_tally(&fed->fed_brw_stats.hist[BRW_R_DISCONT_BLOCKS],
discont_blocks);
}