-LPROC_SEQ_FOPS(lprocfs_nid_stats_clear);
-
-/**
- * Initialize all needed procfs entries for OFD device.
- *
- * \param[in] ofd OFD device
- *
- * \retval 0 if successful
- * \retval negative value on error
- */
-static int ofd_procfs_init(struct ofd_device *ofd)
-{
- struct obd_device *obd = ofd_obd(ofd);
- struct proc_dir_entry *entry;
- int rc = 0;
-
- ENTRY;
-
- /* lprocfs must be setup before the ofd so state can be safely added
- * to /proc incrementally as the ofd is setup */
- obd->obd_vars = lprocfs_ofd_obd_vars;
- rc = lprocfs_obd_setup(obd, false);
- if (rc) {
- CERROR("%s: lprocfs_obd_setup failed: %d.\n",
- obd->obd_name, rc);
- RETURN(rc);
- }
-
- rc = lprocfs_alloc_obd_stats(obd, LPROC_OFD_STATS_LAST);
- if (rc) {
- CERROR("%s: lprocfs_alloc_obd_stats failed: %d.\n",
- obd->obd_name, rc);
- GOTO(obd_cleanup, rc);
- }
-
- obd->obd_uses_nid_stats = 1;
-
- entry = lprocfs_register("exports", obd->obd_proc_entry, NULL, NULL);
- if (IS_ERR(entry)) {
- rc = PTR_ERR(entry);
- CERROR("%s: error %d setting up lprocfs for %s\n",
- obd->obd_name, rc, "exports");
- GOTO(obd_cleanup, rc);
- }
- obd->obd_proc_exports_entry = entry;
-
- entry = lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
- obd, &lprocfs_nid_stats_clear_fops);
- if (IS_ERR(entry)) {
- rc = PTR_ERR(entry);
- CERROR("%s: add proc entry 'clear' failed: %d.\n",
- obd->obd_name, rc);
- GOTO(obd_cleanup, rc);
- }
-
- ofd_stats_counter_init(obd->obd_stats);
-
- rc = lprocfs_job_stats_init(obd, LPROC_OFD_STATS_LAST,
- ofd_stats_counter_init);
- if (rc)
- GOTO(obd_cleanup, rc);
- RETURN(0);
-obd_cleanup:
- lprocfs_obd_cleanup(obd);
- lprocfs_free_obd_stats(obd);
-
- return rc;
-}
-