Whamcloud - gitweb
LU-1346 libcfs: cleanup waitq related primitives
[fs/lustre-release.git] / lustre / osc / osc_request.c
index 0103e53..d5be348 100644 (file)
@@ -690,32 +690,32 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
 }
 
 static int osc_destroy_interpret(const struct lu_env *env,
-                                 struct ptlrpc_request *req, void *data,
-                                 int rc)
+                                struct ptlrpc_request *req, void *data,
+                                int rc)
 {
-        struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
+       struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
 
-        cfs_atomic_dec(&cli->cl_destroy_in_flight);
-        cfs_waitq_signal(&cli->cl_destroy_waitq);
-        return 0;
+       cfs_atomic_dec(&cli->cl_destroy_in_flight);
+       wake_up(&cli->cl_destroy_waitq);
+       return 0;
 }
 
 static int osc_can_send_destroy(struct client_obd *cli)
 {
-        if (cfs_atomic_inc_return(&cli->cl_destroy_in_flight) <=
-            cli->cl_max_rpcs_in_flight) {
-                /* The destroy request can be sent */
-                return 1;
-        }
-        if (cfs_atomic_dec_return(&cli->cl_destroy_in_flight) <
-            cli->cl_max_rpcs_in_flight) {
-                /*
-                 * The counter has been modified between the two atomic
-                 * operations.
-                 */
-                cfs_waitq_signal(&cli->cl_destroy_waitq);
-        }
-        return 0;
+       if (cfs_atomic_inc_return(&cli->cl_destroy_in_flight) <=
+           cli->cl_max_rpcs_in_flight) {
+               /* The destroy request can be sent */
+               return 1;
+       }
+       if (cfs_atomic_dec_return(&cli->cl_destroy_in_flight) <
+           cli->cl_max_rpcs_in_flight) {
+               /*
+                * The counter has been modified between the two atomic
+                * operations.
+                */
+               wake_up(&cli->cl_destroy_waitq);
+       }
+       return 0;
 }
 
 int osc_create(const struct lu_env *env, struct obd_export *exp,
@@ -1657,16 +1657,16 @@ static int osc_brw_internal(int cmd, struct obd_export *exp, struct obdo *oa,
                             obd_count page_count, struct brw_page **pga,
                             struct obd_capa *ocapa)
 {
-        struct ptlrpc_request *req;
-        int                    rc;
-        cfs_waitq_t            waitq;
-        int                    generation, resends = 0;
-        struct l_wait_info     lwi;
+       struct ptlrpc_request *req;
+       int                    rc;
+       wait_queue_head_t            waitq;
+       int                    generation, resends = 0;
+       struct l_wait_info     lwi;
 
-        ENTRY;
+       ENTRY;
 
-        cfs_waitq_init(&waitq);
-        generation = exp->exp_obd->u.cli.cl_import->imp_generation;
+       init_waitqueue_head(&waitq);
+       generation = exp->exp_obd->u.cli.cl_import->imp_generation;
 
 restart_bulk:
         rc = osc_brw_prep_request(cmd, &exp->exp_obd->u.cli, oa, lsm,