struct semaphore cli_rpc_sem; /* limits outstanding requests */
- struct list_head cli_sending_head; /* lists protected by ha_mgr lock */
+ spinlock_t cli_lock; /* protects lists */
+ struct list_head cli_sending_head;
struct list_head cli_sent_head;
struct list_head cli_ha_item;
cl->cli_reply_portal = rep_portal;
INIT_LIST_HEAD(&cl->cli_sending_head);
INIT_LIST_HEAD(&cl->cli_sent_head);
+ spin_lock_init(&cl->cli_lock);
sema_init(&cl->cli_rpc_sem, 32);
}
if (request->rq_repmsg != NULL)
OBD_FREE(request->rq_repmsg, request->rq_replen);
- spin_lock(&request->rq_client->cli_ha_mgr->mgr_lock);
- list_del(&request->rq_list);
- spin_unlock(&request->rq_client->cli_ha_mgr->mgr_lock);
+ if (request->rq_client) {
+ spin_lock(&request->rq_client->cli_lock);
+ list_del(&request->rq_list);
+ spin_unlock(&request->rq_client->cli_lock);
+ }
ptlrpc_put_connection(request->rq_connection);
ENTRY;
if (ev->type == PTL_EVENT_SENT) {
- spin_lock(&req->rq_client->cli_ha_mgr->mgr_lock);
+ spin_lock(&req->rq_client->cli_lock);
list_del(&req->rq_list);
list_add(&req->rq_list, &cl->cli_sent_head);
- spin_unlock(&req->rq_client->cli_ha_mgr->mgr_lock);
+ spin_unlock(&req->rq_client->cli_lock);
} else {
// XXX make sure we understand all events, including ACK's
CERROR("Unknown event %d\n", ev->type);
request->rq_replen, request->rq_reqmsg->xid,
request->rq_client->cli_request_portal);
- spin_lock(&request->rq_client->cli_ha_mgr->mgr_lock);
+ spin_lock(&request->rq_client->cli_lock);
list_add(&request->rq_list, &request->rq_client->cli_sending_head);
- spin_unlock(&request->rq_client->cli_ha_mgr->mgr_lock);
+ spin_unlock(&request->rq_client->cli_lock);
rc = ptl_send_buf(request, request->rq_connection,
request->rq_client->cli_request_portal);