/* Send a request and place it on the recvq if successfully sent. Must be called with the server lock held.  */
static int smb_request_send_req(struct smb_request *req)
/* Send a request and place it on the recvq if successfully sent. Must be called with the server lock held.  */
static int smb_request_send_req(struct smb_request *req)
{
	struct smb_sb_info *server = req->rq_server;
	int result;
	if (req->rq_bytes_sent == 0) {
		WSET(req->rq_header, smb_tid, server->opt.tid);
		WSET(req->rq_header, smb_pid, 1);
		WSET(req->rq_header, smb_uid, server->opt.server_uid);
	}
	result = smb_send_request(req);
	if (result < 0 && result != -EAGAIN)
		goto out;
	result = 0;
	if (!(req->rq_flags & SMB_REQ_TRANSMITTED))
		goto out;
	list_move_tail(&req->rq_queue, &server->recvq);
	result = 1;
out:
	return result;
}