Whamcloud - gitweb
LU-6142 lustre: don't take spinlock to read a 'long'.
[fs/lustre-release.git] / lustre / target / barrier.c
index 5b0eff5..6ed91f7 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2017, Intel Corporation.
  *
  * lustre/target/barrier.c
  *
@@ -199,13 +199,11 @@ static int barrier_freeze(const struct lu_env *env,
                RETURN(1);
 
        if (phase1 && inflight != 0) {
-               struct l_wait_info lwi = LWI_TIMEOUT(cfs_time_seconds(left),
-                                                    NULL, NULL);
-
-               rc = l_wait_event(barrier->bi_waitq,
-                                 percpu_counter_sum(&barrier->bi_writers) == 0,
-                                 &lwi);
-               if (rc)
+               rc = wait_event_idle_timeout(
+                       barrier->bi_waitq,
+                       percpu_counter_sum(&barrier->bi_writers) == 0,
+                       cfs_time_seconds(left));
+               if (rc <= 0)
                        RETURN(1);
 
                /* sync again after all inflight modifications done. */