Whamcloud - gitweb
LU-8686 osd: add few more credits if debugging is enabled
[fs/lustre-release.git] / lustre / osp / lwp_dev.c
index 568bbfd..7d47dc7 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2013, 2015, Intel Corporation.
+ * Copyright (c) 2013, 2016, Intel Corporation.
  * Use is subject to license terms.
  *
  * lustre/osp/lwp_dev.c
@@ -361,7 +361,6 @@ static struct lu_device *lwp_device_fini(const struct lu_env *env,
        struct lwp_device       *m = lu2lwp_dev(ludev);
        struct ptlrpc_thread    *thread = &m->lpd_notify_thread;
        struct l_wait_info       lwi = { 0 };
-       struct obd_import       *imp;
        int                      rc;
        ENTRY;
 
@@ -372,8 +371,6 @@ static struct lu_device *lwp_device_fini(const struct lu_env *env,
        if (m->lpd_exp != NULL)
                class_disconnect(m->lpd_exp);
 
-       imp = m->lpd_obd->u.cli.cl_import;
-
        LASSERT(m->lpd_obd);
        ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
        lprocfs_obd_cleanup(m->lpd_obd);
@@ -406,6 +403,8 @@ static int lwp_notify_main(void *args)
        struct ptlrpc_thread    *thread;
 
        LASSERT(exp != NULL);
+       class_export_get(exp);
+
        lwp = lu2lwp_dev(exp->exp_obd->obd_lu_dev);
        thread = &lwp->lpd_notify_thread;
 
@@ -414,6 +413,7 @@ static int lwp_notify_main(void *args)
 
        lustre_notify_lwp_list(exp);
 
+       class_export_put(exp);
        thread_set_flags(thread, SVC_STOPPED);
        wake_up(&thread->t_ctl_waitq);
        return 0;