/* Try to find a request matching this "mid". Typically the first entry will be the matching one.  */
static struct smb_request* find_request(struct smb_sb_info *server, int mid)
/* Try to find a request matching this "mid". Typically the first entry will be the matching one.  */
static struct smb_request* find_request(struct smb_sb_info *server, int mid)
{
	struct list_head *tmp;
	struct smb_request *req = NULL;
	list_for_each(tmp, &server->recvq) {
		req = list_entry(tmp, struct smb_request, rq_queue);
		if (req->rq_mid == mid) {
			break;
		}
		req = NULL;
	}
	if (!req) {
		VERBOSE("received reply with mid %d but no request!\n",
			WVAL(server->header, smb_mid));
		server->rstate = SMB_RECV_DROP;
	}
	return req;
}