static int
sio_dispatch_requests(struct request_queue *q, int force)
{
	struct sio_data *sd = q->elevator->elevator_data;
	struct request *rq = NULL;
	int data_dir = READ;

	/*
	 * Retrieve any expired request after a batch of
	 * sequential requests.
	 */
	if (sd->batched >= sd->fifo_batch)
		rq = sio_choose_expired_request(sd);

	/* Retrieve request */
	if (!rq) {
		if (sd->starved >= sd->writes_starved)
			data_dir = WRITE;

		rq = sio_choose_request(sd, data_dir);
		if (!rq)
			return 0;
	}

	/* Dispatch request */
	sio_dispatch_request(sd, rq);

	return 1;
}
Пример #2
0
static int
sio_dispatch_requests(struct request_queue *q, int force)
{
struct sio_data *sd = q->elevator->elevator_data;
struct request *rq = NULL;

/*
* Retrieve any expired request after a batch of
* sequential requests.
*/
if (sd->batched > sd->fifo_batch) {
sd->batched = 0;
rq = sio_choose_expired_request(sd);
}

/* Retrieve request */
if (!rq) {
rq = sio_choose_request(sd);
if (!rq)
return 0;
}

/* Dispatch request */
sio_dispatch_request(sd, rq);

return 1;
}
static int
sio_dispatch_requests(struct request_queue *q, int force)
{
	struct sio_data *sd = q->elevator->elevator_data;
	struct request *rq = NULL;
	int data_dir = READ;

	if (sd->batched >= sd->fifo_batch) {
		rq = sio_choose_expired_request(sd);
	}

	if (!rq) {
		if (sd->starved >= sd->writes_starved)
			data_dir = WRITE;

		rq = sio_choose_request(sd, data_dir);
		if (!rq)
			return 0;
	}

	sio_dispatch_request(sd, rq);
	return 1;
}