Whamcloud - gitweb
LU-327 cleanup the client import of mgc
[fs/lustre-release.git] / lustre / mdc / mdc_request.c
index 92ebe03..3abdd77 100644 (file)
@@ -1348,8 +1348,7 @@ static int mdc_ioc_changelog_send(struct obd_device *obd,
 
         /* New thread because we should return to user app before
            writing into our pipe */
-        rc = cfs_kernel_thread(mdc_changelog_send_thread, cs,
-                               CLONE_VM | CLONE_FILES);
+        rc = cfs_create_thread(mdc_changelog_send_thread, cs, CFS_DAEMON_FLAGS);
         if (rc >= 0) {
                 CDEBUG(D_CHANGELOG, "start changelog thread: %d\n", rc);
                 return 0;
@@ -2061,18 +2060,8 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                 if (obd->obd_type->typ_refcnt <= 1)
                         libcfs_kkuc_group_rem(0, KUC_GRP_HSM);
 
-                /* If we set up but never connected, the
-                   client import will not have been cleaned. */
-                if (obd->u.cli.cl_import) {
-                        struct obd_import *imp;
-                        cfs_down_write(&obd->u.cli.cl_sem);
-                        imp = obd->u.cli.cl_import;
-                        CERROR("client import never connected\n");
-                        ptlrpc_invalidate_import(imp);
-                        class_destroy_import(imp);
-                        cfs_up_write(&obd->u.cli.cl_sem);
-                        obd->u.cli.cl_import = NULL;
-                }
+                obd_cleanup_client_import(obd);
+
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)
                         CERROR("failed to cleanup llogging subsystems\n");