static void __ncp_next_request(struct ncp_server *server) { struct ncp_request_reply *req; server->rcv.creq = NULL; if (list_empty(&server->tx.requests)) { return; } req = list_entry(server->tx.requests.next, struct ncp_request_reply, req); list_del_init(&req->req); __ncp_start_request(server, req); }
static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req) { down(&server->rcv.creq_sem); if (!ncp_conn_valid(server)) { up(&server->rcv.creq_sem); printk(KERN_ERR "ncpfs: tcp: Server died\n"); return -EIO; } if (server->tx.creq || server->rcv.creq) { req->status = RQ_QUEUED; list_add_tail(&req->req, &server->tx.requests); up(&server->rcv.creq_sem); return 0; } __ncp_start_request(server, req); up(&server->rcv.creq_sem); return 0; }
static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req) { mutex_lock(&server->rcv.creq_mutex); if (!ncp_conn_valid(server)) { mutex_unlock(&server->rcv.creq_mutex); pr_err("tcp: Server died\n"); return -EIO; } ncp_req_get(req); if (server->tx.creq || server->rcv.creq) { req->status = RQ_QUEUED; list_add_tail(&req->req, &server->tx.requests); mutex_unlock(&server->rcv.creq_mutex); return 0; } __ncp_start_request(server, req); mutex_unlock(&server->rcv.creq_mutex); return 0; }