From b8f9edd43df8f3b866b312589cf3fa9f0766b4d3 Mon Sep 17 00:00:00 2001 From: bobijam Date: Fri, 15 Aug 2008 16:55:00 +0000 Subject: [PATCH] trim trailing whitespaces. --- lustre/ptlrpc/client.c | 58 +++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index d4a3ccd..8d57d23 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -211,14 +211,14 @@ void ptlrpc_at_set_req_timeout(struct ptlrpc_request *req) if (AT_OFF) { /* non-AT settings */ - req->rq_timeout = req->rq_import->imp_server_timeout ? + req->rq_timeout = req->rq_import->imp_server_timeout ? obd_timeout / 2 : obd_timeout; lustre_msg_set_timeout(req->rq_reqmsg, req->rq_timeout); return; } at = &req->rq_import->imp_at; - idx = import_at_get_index(req->rq_import, + idx = import_at_get_index(req->rq_import, req->rq_request_portal); serv_est = at_get(&at->iat_service_estimate[idx]); /* add an arbitrary minimum: 125% +5 sec */ @@ -226,13 +226,13 @@ void ptlrpc_at_set_req_timeout(struct ptlrpc_request *req) /* We could get even fancier here, using history to predict increased loading... */ - /* Let the server know what this RPC timeout is by putting it in the + /* Let the server know what this RPC timeout is by putting it in the reqmsg*/ lustre_msg_set_timeout(req->rq_reqmsg, req->rq_timeout); } /* Adjust max service estimate based on server value */ -static void ptlrpc_at_adj_service(struct ptlrpc_request *req) +static void ptlrpc_at_adj_service(struct ptlrpc_request *req) { int idx; unsigned int serv_est, oldse; @@ -250,7 +250,7 @@ static void ptlrpc_at_adj_service(struct ptlrpc_request *req) oldse = at_add(&at->iat_service_estimate[idx], serv_est); if (oldse != 0) CDEBUG(D_ADAPTTO, "The RPC service estimate for %s ptl %d " - "has changed from %d to %d\n", + "has changed from %d to %d\n", req->rq_import->imp_obd->obd_name,req->rq_request_portal, oldse, at_get(&at->iat_service_estimate[idx])); } @@ -281,7 +281,7 @@ static void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req) oldnl = at_add(&at->iat_net_latency, nl); if (oldnl != 0) CDEBUG(D_ADAPTTO, "The network latency for %s (nid %s) " - "has changed from %d to %d\n", + "has changed from %d to %d\n", req->rq_import->imp_obd->obd_name, obd_uuid2str( &req->rq_import->imp_connection->c_remote_uuid), @@ -311,7 +311,7 @@ static int unpack_reply(struct ptlrpc_request *req) } /* Handle an early reply message. - We can't risk the real reply coming in and changing rq_repmsg, + We can't risk the real reply coming in and changing rq_repmsg, so this fn must be called under the rq_lock */ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) { struct lustre_msg *oldmsg, *msgcpy; @@ -322,8 +322,8 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) { req->rq_early = 0; rc = unpack_reply(req); - if (rc) - /* Let's just ignore it - same as if it never got here */ + if (rc) + /* Let's just ignore it - same as if it never got here */ RETURN(rc); /* We've got to make sure another early reply doesn't land on @@ -336,20 +336,20 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) { RETURN(-ENOMEM); } spin_lock(&req->rq_lock); - /* Another reply might have changed the repmsg and replen while + /* Another reply might have changed the repmsg and replen while we dropped the lock; doesn't really matter, just use the latest. If it doesn't fit in oldlen, checksum will be wrong. */ oldmsg = req->rq_repmsg; memcpy(msgcpy, oldmsg, oldlen); - if (lustre_msg_get_cksum(msgcpy) != + if (lustre_msg_get_cksum(msgcpy) != lustre_msg_calc_cksum(msgcpy)) { CDEBUG(D_ADAPTTO, "Early reply checksum mismatch, " "discarding %x != %x\n", lustre_msg_get_cksum(msgcpy), lustre_msg_calc_cksum(msgcpy)); - GOTO(out, rc = -EINVAL); + GOTO(out, rc = -EINVAL); } - /* Our copied msg is valid, now we can adjust the timeouts without + /* Our copied msg is valid, now we can adjust the timeouts without worrying that a new reply will land on the copy. */ req->rq_repmsg = msgcpy; @@ -361,13 +361,13 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) { ptlrpc_at_set_req_timeout(req); olddl = req->rq_deadline; - /* server assumes it now has rq_timeout from when it sent the + /* server assumes it now has rq_timeout from when it sent the early reply, so client should give it at least that long. */ - req->rq_deadline = cfs_time_current_sec() + req->rq_timeout + + req->rq_deadline = cfs_time_current_sec() + req->rq_timeout + ptlrpc_at_get_net_latency(req); - DEBUG_REQ(D_ADAPTTO, req, - "Early reply #%d, new deadline in %lds (%+lds)", + DEBUG_REQ(D_ADAPTTO, req, + "Early reply #%d, new deadline in %lds (%+lds)", req->rq_early_count, req->rq_deadline - cfs_time_current_sec(), req->rq_deadline - olddl); @@ -649,7 +649,7 @@ int ptlrpc_set_add_cb(struct ptlrpc_request_set *set, { struct ptlrpc_set_cbdata *cbdata; - OBD_SLAB_ALLOC(cbdata, ptlrpc_cbdata_slab, + OBD_SLAB_ALLOC(cbdata, ptlrpc_cbdata_slab, CFS_ALLOC_STD, sizeof(*cbdata)); if (cbdata == NULL) RETURN(-ENOMEM); @@ -846,7 +846,7 @@ static int after_reply(struct ptlrpc_request *req) LASSERT (req->rq_nob_received <= req->rq_replen); rc = unpack_reply(req); - if (rc) + if (rc) RETURN(rc); do_gettimeofday(&work_start); @@ -880,7 +880,7 @@ static int after_reply(struct ptlrpc_request *req) RETURN(rc); } } else { - /* Let's look if server sent slv. Do it only for RPC with + /* Let's look if server sent slv. Do it only for RPC with * rc == 0. */ ldlm_cli_update_pool(req); } @@ -1273,7 +1273,7 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req) RETURN(1); } - /* if a request can't be resent we can't wait for an answer after + /* if a request can't be resent we can't wait for an answer after the timeout */ if (req->rq_no_resend) { DEBUG_REQ(D_RPCTRACE, req, "TIMEOUT-NORESEND:"); @@ -1363,7 +1363,7 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set) /* request in-flight? */ if (!(((req->rq_phase == RQ_PHASE_RPC) && !req->rq_waiting) || - (req->rq_phase == RQ_PHASE_BULK) || + (req->rq_phase == RQ_PHASE_BULK) || (req->rq_phase == RQ_PHASE_NEW))) continue; @@ -1445,13 +1445,13 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set) struct ptlrpc_set_cbdata *cbdata, *n; int err; - list_for_each_entry_safe(cbdata, n, + list_for_each_entry_safe(cbdata, n, &set->set_cblist, psc_item) { list_del_init(&cbdata->psc_item); err = cbdata->psc_interpret(set, cbdata->psc_data, rc); if (err && !rc) rc = err; - OBD_SLAB_FREE(cbdata, ptlrpc_cbdata_slab, + OBD_SLAB_FREE(cbdata, ptlrpc_cbdata_slab, sizeof(*cbdata)); } } @@ -1594,7 +1594,7 @@ void ptlrpc_unregister_reply (struct ptlrpc_request *request) LNetMDUnlink (request->rq_reply_md_h); /* We have to l_wait_event() whatever the result, to give liblustre - * a chance to run reply_in_callback(), and to make sure we've + * a chance to run reply_in_callback(), and to make sure we've * unlinked before returning a req to the pool */ if (request->rq_set != NULL) @@ -1891,19 +1891,19 @@ restart: spin_unlock(&imp->imp_lock); rc = ptl_send_rpc(req, 0); - if (rc) + if (rc) DEBUG_REQ(D_HA, req, "send failed (%d); recovering", rc); do { timeoutl = req->rq_deadline - cfs_time_current_sec(); timeout = (timeoutl <= 0 || rc) ? CFS_TICK : cfs_time_seconds(timeoutl); - DEBUG_REQ(D_NET, req, + DEBUG_REQ(D_NET, req, "-- sleeping for "CFS_DURATION_T" ticks", timeout); lwi = LWI_TIMEOUT_INTR(timeout, NULL, interrupted_request, req); brc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), &lwi); /* Wait again if we changed deadline */ - } while ((brc == -ETIMEDOUT) && + } while ((brc == -ETIMEDOUT) && (req->rq_deadline > cfs_time_current_sec())); if ((brc == -ETIMEDOUT) && !ptlrpc_expire_one_request(req)) { @@ -1930,7 +1930,7 @@ restart: if (req->rq_err) { - DEBUG_REQ(D_RPCTRACE, req, "err rc=%d status=%d", + DEBUG_REQ(D_RPCTRACE, req, "err rc=%d status=%d", rc, req->rq_status); GOTO(out, rc = -EIO); } -- 1.8.3.1