}
}
- /* NB we ABSOLUTELY RELY on req being zeroed, so pointers are NULL,
- * flags are reset and scalars are zero. We only set the message
- * size to non-zero if this was a successful receive. */
- req->rq_xid = ev->match_bits;
- req->rq_reqbuf = ev->md.start + ev->offset;
+ ptlrpc_srv_req_init(req);
+ /* NB we ABSOLUTELY RELY on req being zeroed, so pointers are NULL,
+ * flags are reset and scalars are zero. We only set the message
+ * size to non-zero if this was a successful receive. */
+ req->rq_xid = ev->match_bits;
+ req->rq_reqbuf = ev->md.start + ev->offset;
if (ev->type == LNET_EVENT_PUT && ev->status == 0)
req->rq_reqdata_len = ev->mlength;
do_gettimeofday(&req->rq_arrival_time);
req->rq_peer = ev->initiator;
req->rq_self = ev->target.nid;
req->rq_rqbd = rqbd;
- req->rq_phase = RQ_PHASE_NEW;
- spin_lock_init(&req->rq_lock);
- INIT_LIST_HEAD(&req->rq_timed_list);
- INIT_LIST_HEAD(&req->rq_exp_list);
- atomic_set(&req->rq_refcount, 1);
+ req->rq_phase = RQ_PHASE_NEW;
if (ev->type == LNET_EVENT_PUT)
CDEBUG(D_INFO, "incoming req@%p x"LPU64" msgsize %u\n",
req, req->rq_xid, ev->mlength);