Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible
[fs/lustre-release.git] / lustre / ldlm / ldlm_resource.c
index d1ace7a..490e7c5 100644 (file)
@@ -111,9 +111,10 @@ static ssize_t seq_watermark_write(struct file *file,
                                   const char __user *buffer, size_t count,
                                   loff_t *off)
 {
+       struct seq_file *m = file->private_data;
        u64 value;
        __u64 watermark;
-       __u64 *data = ((struct seq_file *)file->private_data)->private;
+       __u64 *data = m->private;
        bool wm_low = (data == &ldlm_reclaim_threshold_mb) ? true : false;
        char kernbuf[22] = "";
        int rc;
@@ -1055,11 +1056,10 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
                         */
                        unlock_res(res);
                        LDLM_DEBUG(lock, "setting FL_LOCAL_ONLY");
-                       if (lock->l_flags & LDLM_FL_FAIL_LOC) {
-                               set_current_state(TASK_UNINTERRUPTIBLE);
-                               schedule_timeout(cfs_time_seconds(4));
-                               set_current_state(TASK_RUNNING);
-                       }
+                       if (lock->l_flags & LDLM_FL_FAIL_LOC)
+                               schedule_timeout_uninterruptible(
+                                       cfs_time_seconds(4));
+
                        if (lock->l_completion_ast)
                                lock->l_completion_ast(lock,
                                                       LDLM_FL_FAILED, NULL);