Whamcloud - gitweb
LU-3498 kernel: remove uses of IS_ERR_VALUE()
[fs/lustre-release.git] / lustre / ldlm / ldlm_lockd.c
index 6580b8d..1e3bc7a 100644 (file)
@@ -2771,11 +2771,15 @@ EXPORT_SYMBOL(ldlm_destroy_export);
 static int ldlm_setup(void)
 {
        static struct ptlrpc_service_conf       conf;
-       struct ldlm_bl_pool                     *blp = NULL;
-        int rc = 0;
+       struct ldlm_bl_pool                    *blp = NULL;
 #ifdef __KERNEL__
-        int i;
+# ifdef HAVE_SERVER_SUPPORT
+       struct task_struct *task;
+# endif
+       int i;
 #endif
+       int rc = 0;
+
         ENTRY;
 
         if (ldlm_state != NULL)
@@ -2910,8 +2914,9 @@ static int ldlm_setup(void)
        spin_lock_init(&waiting_locks_spinlock);
        cfs_timer_init(&waiting_locks_timer, waiting_locks_callback, 0);
 
-       rc = PTR_ERR(kthread_run(expired_lock_main, NULL, "ldlm_elt"));
-       if (IS_ERR_VALUE(rc)) {
+       task = kthread_run(expired_lock_main, NULL, "ldlm_elt");
+       if (IS_ERR(task)) {
+               rc = PTR_ERR(task);
                CERROR("Cannot start ldlm expired-lock thread: %d\n", rc);
                GOTO(out, rc);
        }