Whamcloud - gitweb
LU-8066 ptlrpc: migrate ptlrpc proc files to sysfs
[fs/lustre-release.git] / lustre / ost / ost_handler.c
index 63fcc84..f0d351a 100644 (file)
@@ -67,6 +67,8 @@ MODULE_PARM_DESC(oss_io_cpts, "CPU partitions OSS IO threads should run on");
 
 static struct cfs_cpt_table    *ost_io_cptable;
 
+static struct kset *oss_kset;
+
 /* Sigh - really, this is an OSS, the _server_, not the _target_ */
 static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
@@ -76,7 +78,9 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
        int rc;
        ENTRY;
 
-       lprocfs_obd_setup(obd, true);
+       rc = lprocfs_kset_register(obd, &oss_kset);
+       if (rc)
+               return rc;
 
        mutex_init(&ost->ost_health_mutex);
 
@@ -110,7 +114,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .so_hpreq_handler       = ptlrpc_hpreq_handler,
                },
        };
-       ost->ost_service = ptlrpc_register_service(&svc_conf,
+       ost->ost_service = ptlrpc_register_service(&svc_conf, oss_kset,
                                                   obd->obd_proc_entry);
        if (IS_ERR(ost->ost_service)) {
                rc = PTR_ERR(ost->ost_service);
@@ -148,7 +152,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .so_req_printer         = target_print_req,
                },
        };
-       ost->ost_create_service = ptlrpc_register_service(&svc_conf,
+       ost->ost_create_service = ptlrpc_register_service(&svc_conf, oss_kset,
                                                          obd->obd_proc_entry);
        if (IS_ERR(ost->ost_create_service)) {
                rc = PTR_ERR(ost->ost_create_service);
@@ -216,7 +220,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .so_req_printer         = target_print_req,
                },
        };
-       ost->ost_io_service = ptlrpc_register_service(&svc_conf,
+       ost->ost_io_service = ptlrpc_register_service(&svc_conf, oss_kset,
                                                      obd->obd_proc_entry);
        if (IS_ERR(ost->ost_io_service)) {
                rc = PTR_ERR(ost->ost_io_service);
@@ -257,7 +261,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .so_hpreq_handler       = NULL,
                },
        };
-       ost->ost_seq_service = ptlrpc_register_service(&svc_conf,
+       ost->ost_seq_service = ptlrpc_register_service(&svc_conf, oss_kset,
                                                      obd->obd_proc_entry);
        if (IS_ERR(ost->ost_seq_service)) {
                rc = PTR_ERR(ost->ost_seq_service);
@@ -303,7 +307,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .so_hpreq_handler       = NULL,
                },
        };
-       ost->ost_out_service = ptlrpc_register_service(&svc_conf,
+       ost->ost_out_service = ptlrpc_register_service(&svc_conf, oss_kset,
                                                       obd->obd_proc_entry);
        if (IS_ERR(ost->ost_out_service)) {
                rc = PTR_ERR(ost->ost_out_service);
@@ -329,7 +333,7 @@ out_service:
         ptlrpc_unregister_service(ost->ost_service);
         ost->ost_service = NULL;
 out_lprocfs:
-        lprocfs_obd_cleanup(obd);
+       lprocfs_kset_unregister(obd, oss_kset);
         RETURN(rc);
 }
 
@@ -359,7 +363,7 @@ static int ost_cleanup(struct obd_device *obd)
 
        mutex_unlock(&ost->ost_health_mutex);
 
-       lprocfs_obd_cleanup(obd);
+       lprocfs_kset_unregister(obd, oss_kset);
 
        if (ost_io_cptable != NULL) {
                cfs_cpt_table_free(ost_io_cptable);