Whamcloud - gitweb
LU-15151 tests: use facet check instead of node check
[fs/lustre-release.git] / lustre / target / barrier.c
index b9363a2..4f8c5b3 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2017, Intel Corporation.
  *
  * lustre/target/barrier.c
  *
 
 #include <linux/percpu_counter.h>
 
-#include <lustre/lustre_idl.h>
 #include <dt_object.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_barrier.h>
-#include <lustre/lustre_barrier_user.h>
+#include <uapi/linux/lustre/lustre_barrier_user.h>
 
 static LIST_HEAD(barrier_instance_list);
 static DEFINE_SPINLOCK(barrier_instance_lock);
@@ -200,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. */
@@ -275,7 +272,7 @@ void barrier_exit(struct dt_device *key)
                smp_mb();
 
                if (unlikely(barrier->bi_status == BS_FREEZING_P1))
-                       wake_up_all(&barrier->bi_waitq);
+                       wake_up(&barrier->bi_waitq);
                barrier_instance_put(barrier);
        }
 }
@@ -291,7 +288,7 @@ int barrier_handler(struct dt_device *key, struct ptlrpc_request *req)
        ENTRY;
 
        /* glimpse on barrier locks always packs a glimpse descriptor */
-       req_capsule_extend(&req->rq_pill, &RQF_LDLM_GL_DESC_CALLBACK);
+       req_capsule_extend(&req->rq_pill, &RQF_LDLM_GL_CALLBACK_DESC);
        desc = req_capsule_client_get(&req->rq_pill, &RMF_DLM_GL_DESC);
        if (!desc)
                GOTO(out, rc = -EPROTO);