static int deadline_dispatch_requests(struct deadline_data *dd) 
static int deadline_dispatch_requests(request_queue_t *q, int force) 
static int deadline_dispatch_requests(struct deadline_data *dd){	const int reads = !list_empty(&dd->fifo_list[READ]);	const int writes = !list_empty(&dd->fifo_list[WRITE]);	struct deadline_rq *drq;	int data_dir;	/*	 * batches are currently reads XOR writes	 */	if (dd->next_drq[WRITE])		drq = dd->next_drq[WRITE];	else		drq = dd->next_drq[READ];	if (drq) {		/* we have a "next request" */				if (dd->last_sector != drq->request->sector)			/* end the batch on a non sequential request */			dd->batching += dd->fifo_batch;				if (dd->batching < dd->fifo_batch)			/* we are still entitled to batch */			goto dispatch_request;	}	/*	 * at this point we are not running a batch. select the appropriate	 * data direction (read / write)	 */	if (reads) {		BUG_ON(RB_EMPTY(&dd->sort_list[READ]));		if (writes && (dd->starved++ >= dd->writes_starved))			goto dispatch_writes;		data_dir = READ;		goto dispatch_find_request;	}	/*	 * there are either no reads or writes have been starved	 */	if (writes) {dispatch_writes:		BUG_ON(RB_EMPTY(&dd->sort_list[WRITE]));		dd->starved = 0;		data_dir = WRITE;		goto dispatch_find_request;	}	return 0;dispatch_find_request:	/*	 * we are not running a batch, find best request for selected data_dir	 */	if (deadline_check_fifo(dd, data_dir)) {		/* An expired request exists - satisfy it */		dd->batching = 0;		drq = list_entry_fifo(dd->fifo_list[data_dir].next);			} else if (dd->next_drq[data_dir]) {		/*		 * The last req was the same dir and we have a next request in		 * sort order. No expired requests so continue on from here.		 */		drq = dd->next_drq[data_dir];	} else {		/*		 * The last req was the other direction or we have run out of		 * higher-sectored requests. Go back to the lowest sectored		 * request (1 way elevator) and start a new batch.		 */		dd->batching = 0;		drq = deadline_find_first_drq(dd, data_dir);	}dispatch_request:	/*	 * drq is the selected appropriate request.	 */	dd->batching++;	deadline_move_request(dd, drq);	return 1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b4878f245ec8e168cdd1f170f823a750b7dd4af5/deadline-iosched.c/clean/drivers/block/deadline-iosched.c