staging: lustre: fix gfp_t/int coercion
[deliverable/linux.git] / drivers / staging / lustre / lustre / ptlrpc / client.c
index 4146e8b29a6d4edfebcd69a087a576a275da41cf..38cc931a189c32cdf04afc584a86cd314208509b 100644 (file)
@@ -267,7 +267,7 @@ static void ptlrpc_at_adj_service(struct ptlrpc_request *req,
        if (oldse != 0)
                CDEBUG(D_ADAPTTO, "The RPC service estimate for %s ptl %d "
                       "has changed from %d to %d\n",
-                      req->rq_import->imp_obd->obd_name,req->rq_request_portal,
+                      req->rq_import->imp_obd->obd_name, req->rq_request_portal,
                       oldse, at_get(&at->iat_service_estimate[idx]));
 }
 
@@ -289,7 +289,7 @@ static void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req,
        at = &req->rq_import->imp_at;
 
        /* Network latency is total time less server processing time */
-       nl = max_t(int, now - req->rq_sent - service_time, 0) +1/*st rounding*/;
+       nl = max_t(int, now - req->rq_sent - service_time, 0) + 1/*st rounding*/;
        if (service_time > now - req->rq_sent + 3 /* bz16408 */)
                CWARN("Reported service time %u > total measured time "
                      CFS_DURATION_T"\n", service_time,
@@ -313,14 +313,14 @@ static int unpack_reply(struct ptlrpc_request *req)
                rc = ptlrpc_unpack_rep_msg(req, req->rq_replen);
                if (rc) {
                        DEBUG_REQ(D_ERROR, req, "unpack_rep failed: %d", rc);
-                       return(-EPROTO);
+                       return -EPROTO;
                }
        }
 
        rc = lustre_unpack_rep_ptlrpc_body(req, MSG_PTLRPC_BODY_OFF);
        if (rc) {
                DEBUG_REQ(D_ERROR, req, "unpack ptlrpc body failed: %d", rc);
-               return(-EPROTO);
+               return -EPROTO;
        }
        return 0;
 }
@@ -394,7 +394,7 @@ void ptlrpc_request_cache_fini(void)
        kmem_cache_destroy(request_cache);
 }
 
-struct ptlrpc_request *ptlrpc_request_cache_alloc(int flags)
+struct ptlrpc_request *ptlrpc_request_cache_alloc(gfp_t flags)
 {
        struct ptlrpc_request *req;
 
@@ -578,7 +578,7 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
        else {
                rc = sptlrpc_req_get_ctx(request);
                if (rc)
-                       GOTO(out_free, rc);
+                       goto out_free;
        }
 
        sptlrpc_req_set_flavor(request, opcode);
@@ -587,7 +587,7 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                                 lengths, bufs);
        if (rc) {
                LASSERT(!request->rq_pool);
-               GOTO(out_ctx, rc);
+               goto out_ctx;
        }
 
        lustre_msg_add_version(request->rq_reqmsg, version);
@@ -721,7 +721,7 @@ struct ptlrpc_request *__ptlrpc_request_alloc(struct obd_import *imp,
  */
 static struct ptlrpc_request *
 ptlrpc_request_alloc_internal(struct obd_import *imp,
-                             struct ptlrpc_request_pool * pool,
+                             struct ptlrpc_request_pool *pool,
                              const struct req_format *format)
 {
        struct ptlrpc_request *request;
@@ -751,7 +751,7 @@ EXPORT_SYMBOL(ptlrpc_request_alloc);
  * initialize its buffer structure according to capsule template \a format.
  */
 struct ptlrpc_request *ptlrpc_request_alloc_pool(struct obd_import *imp,
-                                           struct ptlrpc_request_pool * pool,
+                                           struct ptlrpc_request_pool *pool,
                                            const struct req_format *format)
 {
        return ptlrpc_request_alloc_internal(imp, pool, format);
@@ -1585,7 +1585,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                        continue;
 
                if (req->rq_phase == RQ_PHASE_INTERPRET)
-                       GOTO(interpret, req->rq_status);
+                       goto interpret;
 
                /*
                 * Note that this also will start async reply unlink.
@@ -1604,7 +1604,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                if (req->rq_status == 0)
                                        req->rq_status = -EIO;
                                ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
-                               GOTO(interpret, req->rq_status);
+                               goto interpret;
                        } else {
                                continue;
                        }
@@ -1617,7 +1617,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                        if (req->rq_status == 0)
                                req->rq_status = -EIO;
                        ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
-                       GOTO(interpret, req->rq_status);
+                       goto interpret;
                }
 
                /* ptlrpc_set_wait->l_wait_event sets lwi_allow_intr
@@ -1633,7 +1633,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                     req->rq_wait_ctx)) {
                        req->rq_status = -EINTR;
                        ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
-                       GOTO(interpret, req->rq_status);
+                       goto interpret;
                }
 
                if (req->rq_phase == RQ_PHASE_RPC) {
@@ -1662,7 +1662,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                        ptlrpc_rqphase_move(req,
                                                RQ_PHASE_INTERPRET);
                                        spin_unlock(&imp->imp_lock);
-                                       GOTO(interpret, req->rq_status);
+                                       goto interpret;
                                }
                                if (ptlrpc_no_resend(req) &&
                                    !req->rq_wait_ctx) {
@@ -1670,7 +1670,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                        ptlrpc_rqphase_move(req,
                                                            RQ_PHASE_INTERPRET);
                                        spin_unlock(&imp->imp_lock);
-                                       GOTO(interpret, req->rq_status);
+                                       goto interpret;
                                }
 
                                list_del_init(&req->rq_list);
@@ -1780,7 +1780,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                         */
                        if (req->rq_bulk == NULL || req->rq_status < 0) {
                                ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
-                               GOTO(interpret, req->rq_status);
+                               goto interpret;
                        }
 
                        ptlrpc_rqphase_move(req, RQ_PHASE_BULK);
@@ -2041,8 +2041,6 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
        struct ptlrpc_request *req;
        int                 deadline;
 
-       SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */
-
        list_for_each(tmp, &set->set_requests) {
                req = list_entry(tmp, struct ptlrpc_request, rq_set_chain);
 
@@ -2132,7 +2130,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set)
                         * interrupts are allowed. Wait until all
                         * complete, or an in-flight req times out.
                         */
-                       lwi = LWI_TIMEOUT(cfs_time_seconds(timeout? timeout : 1),
+                       lwi = LWI_TIMEOUT(cfs_time_seconds(timeout ? timeout : 1),
                                          ptlrpc_expired_set, set);
 
                rc = l_wait_event(set->set_waitq, ptlrpc_check_set(NULL, set), &lwi);
@@ -2186,7 +2184,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set)
        }
 
        if (set->set_interpret != NULL) {
-               int (*interpreter)(struct ptlrpc_request_set *set,void *,int) =
+               int (*interpreter)(struct ptlrpc_request_set *set, void *, int) =
                        set->set_interpret;
                rc = interpreter (set, set->set_arg, rc);
        } else {
@@ -2222,7 +2220,7 @@ static void __ptlrpc_free_req(struct ptlrpc_request *request, int locked)
        }
 
        LASSERTF(!request->rq_receiving_reply, "req %p\n", request);
-       LASSERTF(request->rq_rqbd == NULL, "req %p\n",request);/* client-side */
+       LASSERTF(request->rq_rqbd == NULL, "req %p\n", request);/* client-side */
        LASSERTF(list_empty(&request->rq_list), "req %p\n", request);
        LASSERTF(list_empty(&request->rq_set_chain), "req %p\n", request);
        LASSERTF(list_empty(&request->rq_exp_list), "req %p\n", request);
@@ -2491,7 +2489,7 @@ void ptlrpc_free_committed(struct obd_import *imp)
                }
                if (req->rq_import_generation < imp->imp_generation) {
                        DEBUG_REQ(D_RPCTRACE, req, "free request with old gen");
-                       GOTO(free_req, 0);
+                       goto free_req;
                }
 
                /* not yet committed */
@@ -2692,7 +2690,7 @@ struct ptlrpc_replay_async_args {
  */
 static int ptlrpc_replay_interpret(const struct lu_env *env,
                                   struct ptlrpc_request *req,
-                                  void * data, int rc)
+                                  void *data, int rc)
 {
        struct ptlrpc_replay_async_args *aa = data;
        struct obd_import *imp = req->rq_import;
@@ -2701,13 +2699,16 @@ static int ptlrpc_replay_interpret(const struct lu_env *env,
 
        if (!ptlrpc_client_replied(req)) {
                CERROR("request replay timed out, restarting recovery\n");
-               GOTO(out, rc = -ETIMEDOUT);
+               rc = -ETIMEDOUT;
+               goto out;
        }
 
        if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR &&
            (lustre_msg_get_status(req->rq_repmsg) == -ENOTCONN ||
-            lustre_msg_get_status(req->rq_repmsg) == -ENODEV))
-               GOTO(out, rc = lustre_msg_get_status(req->rq_repmsg));
+            lustre_msg_get_status(req->rq_repmsg) == -ENODEV)) {
+               rc = lustre_msg_get_status(req->rq_repmsg);
+               goto out;
+       }
 
        /** VBR: check version failure */
        if (lustre_msg_get_status(req->rq_repmsg) == -EOVERFLOW) {
@@ -2742,7 +2743,8 @@ static int ptlrpc_replay_interpret(const struct lu_env *env,
                          "Reported transno %llu is bigger than the replayed one: %llu",
                          req->rq_transno,
                          lustre_msg_get_transno(req->rq_reqmsg));
-               GOTO(out, rc = -EINVAL);
+               rc = -EINVAL;
+               goto out;
        }
 
        DEBUG_REQ(D_HA, req, "got rep");
This page took 0.035013 seconds and 5 git commands to generate.