Whamcloud - gitweb
LU-3319 procfs: move osp proc handling to seq_files
[fs/lustre-release.git] / lustre / osp / lwp_dev.c
index 85c2641..755c096 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012 Intel Corporation
+ * Copyright (c) 2013, Intel Corporation.
  * Use is subject to license terms.
  *
  * lustre/osp/lwp_dev.c
@@ -32,9 +32,6 @@
  * Author: <di.wang@intel.com>
  * Author: <yawei.niu@intel.com>
  */
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 #define DEBUG_SUBSYSTEM S_OST
 
 #include <obd_class.h>
@@ -148,6 +145,7 @@ out:
                lustre_cfg_free(lcfg);
        if (rc)
                client_obd_cleanup(lwp->lpd_obd);
+
        RETURN(rc);
 }
 
@@ -212,25 +210,13 @@ const struct lu_device_operations lwp_lu_ops = {
        .ldo_process_config     = lwp_process_config,
 };
 
-static struct lprocfs_vars lprocfs_lwp_module_vars[] = {
-       { "num_refs",           lprocfs_rd_numrefs, 0, 0 },
-       { 0 }
-};
-
-static struct lprocfs_vars lprocfs_lwp_obd_vars[] = {
+static struct lprocfs_seq_vars lprocfs_lwp_obd_vars[] = {
        { 0 }
 };
 
-void lprocfs_lwp_init_vars(struct lprocfs_static_vars *lvars)
-{
-       lvars->module_vars = lprocfs_lwp_module_vars;
-       lvars->obd_vars = lprocfs_lwp_obd_vars;
-}
-
 int lwp_init0(const struct lu_env *env, struct lwp_device *lwp,
              struct lu_device_type *ldt, struct lustre_cfg *cfg)
 {
-       struct lprocfs_static_vars lvars = { 0 };
        int                        rc;
        ENTRY;
 
@@ -259,8 +245,8 @@ int lwp_init0(const struct lu_env *env, struct lwp_device *lwp,
                RETURN(rc);
        }
 
-       lprocfs_lwp_init_vars(&lvars);
-       if (lprocfs_obd_setup(lwp->lpd_obd, lvars.obd_vars) == 0)
+       lwp->lpd_obd->obd_vars = lprocfs_lwp_obd_vars;
+       if (lprocfs_seq_obd_setup(lwp->lpd_obd) == 0)
                ptlrpc_lprocfs_register_obd(lwp->lpd_obd);
 
        RETURN(0);
@@ -324,8 +310,6 @@ static struct lu_device *lwp_device_fini(const struct lu_env *env,
                imp->imp_rq_pool = NULL;
        }
 
-       obd_cleanup_client_import(m->lpd_obd);
-
        LASSERT(m->lpd_obd);
        ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
        lprocfs_obd_cleanup(m->lpd_obd);