} 
static struct request *get_request(request_queue_t *q, int rw, struct bio *bio,				   int gfp_mask){	struct request *rq = NULL;	struct request_list *rl = &q->rq;	struct io_context *ioc = current_io_context(GFP_ATOMIC);	if (unlikely(test_bit(QUEUE_FLAG_DRAIN, &q->queue_flags)))		goto out;	if (rl->count[rw]+1 >= q->nr_requests) {		/*		 * The queue will fill after this allocation, so set it as		 * full, and mark this process as "batching". This process		 * will be allowed to complete a batch of requests, others		 * will be blocked.		 */		if (!blk_queue_full(q, rw)) {			ioc_set_batching(q, ioc);			blk_set_queue_full(q, rw);		}	}	switch (elv_may_queue(q, rw, bio)) {		case ELV_MQUEUE_NO:			goto rq_starved;		case ELV_MQUEUE_MAY:			break;		case ELV_MQUEUE_MUST:			goto get_rq;	}	if (blk_queue_full(q, rw) && !ioc_batching(q, ioc)) {		/*		 * The queue is full and the allocating process is not a		 * "batcher", and not exempted by the IO scheduler		 */		goto out;	}get_rq:	/*	 * Only allow batching queuers to allocate up to 50% over the defined	 * limit of requests, otherwise we could have thousands of requests	 * allocated with any setting of ->nr_requests	 */	if (rl->count[rw] >= (3 * q->nr_requests / 2)) {		spin_unlock_irq(q->queue_lock);		goto out;	}	rl->count[rw]++;	rl->starved[rw] = 0;	if (rl->count[rw] >= queue_congestion_on_threshold(q))		set_queue_congested(q, rw);	spin_unlock_irq(q->queue_lock);	rq = blk_alloc_request(q, rw, bio, gfp_mask);	if (!rq) {		/*		 * Allocation failed presumably due to memory. Undo anything		 * we might have messed up.		 *		 * Allocating task should really be put onto the front of the		 * wait queue, but this is pretty rare.		 */		spin_lock_irq(q->queue_lock);		freed_request(q, rw);		/*		 * in the very unlikely event that allocation failed and no		 * requests for this direction was pending, mark us starved		 * so that freeing of a request in the other direction will		 * notice us. another possible fix would be to split the		 * rq mempool into READ and WRITE		 */rq_starved:		if (unlikely(rl->count[rw] == 0))			rl->starved[rw] = 1;		goto out;	}	if (ioc_batching(q, ioc))		ioc->nr_batch_requests--;		rq_init(q, rq);	rq->rl = rl;out:	return rq;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fd782a4a99d2d3e818b9465c427b10f7f027d7da/ll_rw_blk.c/buggy/drivers/block/ll_rw_blk.c