cfs_waitq_init(&desc->bd_waitq);
desc->bd_max_iov = npages;
desc->bd_iov_count = 0;
- desc->bd_md_h = LNET_INVALID_HANDLE;
+ LNetInvalidateHandle(&desc->bd_md_h);
desc->bd_portal = portal;
desc->bd_type = type;
if (req->rq_phase == RQ_PHASE_NEW) {
if (req->rq_interpret_reply != NULL) {
- int (*interpreter)(struct ptlrpc_request *,
- void *, int) =
+ ptlrpc_interpterer_t interpreter =
req->rq_interpret_reply;
/* higher level (i.e. LOV) failed;
* let the sub reqs clean up */
req->rq_status = -EBADR;
- interpreter(req, &req->rq_async_args,
+ interpreter(NULL, req, &req->rq_async_args,
req->rq_status);
}
set->set_remaining--;
}
/* this sends any unsent RPCs in @set and returns TRUE if all are sent */
-int ptlrpc_check_set(struct ptlrpc_request_set *set)
+int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
{
struct list_head *tmp;
int force_timer_recalc = 0;
spin_unlock(&imp->imp_lock);
req->rq_waiting = 0;
- if (req->rq_resend) {
+
+ if (req->rq_timedout||req->rq_resend) {
+ /* This is re-sending anyways,
+ * let's mark req as resend. */
+ req->rq_resend = 1;
lustre_msg_add_flags(req->rq_reqmsg,
MSG_RESENT);
if (req->rq_bulk) {
ptlrpc_unregister_bulk (req);
if (req->rq_interpret_reply != NULL) {
- int (*interpreter)(struct ptlrpc_request *,void *,int) =
+ ptlrpc_interpterer_t interpreter =
req->rq_interpret_reply;
- req->rq_status = interpreter(req, &req->rq_async_args,
+ req->rq_status = interpreter(NULL, req,
+ &req->rq_async_args,
req->rq_status);
}
req->rq_phase = RQ_PHASE_COMPLETE;
lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(timeout ? timeout : 1),
ptlrpc_expired_set,
ptlrpc_interrupted_set, set);
- rc = l_wait_event(set->set_waitq, ptlrpc_check_set(set), &lwi);
+ rc = l_wait_event(set->set_waitq,
+ ptlrpc_check_set(NULL, set), &lwi);
LASSERT(rc == 0 || rc == -EINTR || rc == -ETIMEDOUT);
"-- sleeping for "CFS_DURATION_T" ticks", timeout);
lwi = LWI_TIMEOUT_INTR(timeout, expired_request, interrupted_request,
req);
- rc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), &lwi);
- if (rc == -ETIMEDOUT && ((req->rq_deadline > cfs_time_current_sec()) ||
+ brc = l_wait_event(req->rq_reply_waitq, ptlrpc_check_reply(req), &lwi);
+ if (brc == -ETIMEDOUT && ((req->rq_deadline > cfs_time_current_sec()) ||
ptlrpc_check_and_wait_suspend(req)))
goto repeat;
if (req->rq_err) {
DEBUG_REQ(D_RPCTRACE, req, "err rc=%d status=%d",
rc, req->rq_status);
- GOTO(out, rc = -EIO);
+ GOTO(out, rc = rc ? rc : -EIO);
}
if (req->rq_intr) {
int praa_old_status;
};
-static int ptlrpc_replay_interpret(struct ptlrpc_request *req,
+static int ptlrpc_replay_interpret(const struct lu_env *env,
+ struct ptlrpc_request *req,
void * data, int rc)
{
struct ptlrpc_replay_async_args *aa = data;