public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* noop insert
@ 2004-12-23 16:01 Shailabh Nagar
  2004-12-24 10:07 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Shailabh Nagar @ 2004-12-23 16:01 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

In noop-iosched.c (2.6.10-rc2),

void elevator_noop_add_request(request_queue_t *q, struct request *rq,
			       int where)
{
	struct list_head *insert = q->queue_head.prev;

	if (where == ELEVATOR_INSERT_FRONT)
		insert = &q->queue_head;

	list_add_tail(&rq->queuelist, &q->queue_head);
<snip>

shouldn't the insertion happen at insert instead of q->queue_head ?

-- Shailabh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: noop insert
  2004-12-23 16:01 noop insert Shailabh Nagar
@ 2004-12-24 10:07 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2004-12-24 10:07 UTC (permalink / raw)
  To: Shailabh Nagar; +Cc: linux-kernel

On Thu, Dec 23 2004, Shailabh Nagar wrote:
> In noop-iosched.c (2.6.10-rc2),
> 
> void elevator_noop_add_request(request_queue_t *q, struct request *rq,
> 			       int where)
> {
> 	struct list_head *insert = q->queue_head.prev;
> 
> 	if (where == ELEVATOR_INSERT_FRONT)
> 		insert = &q->queue_head;
> 
> 	list_add_tail(&rq->queuelist, &q->queue_head);
> <snip>
> 
> shouldn't the insertion happen at insert instead of q->queue_head ?

Yeah, it looks broken. This is easier to read and correct :-)

===== drivers/block/noop-iosched.c 1.4 vs edited =====
--- 1.4/drivers/block/noop-iosched.c	2004-10-19 11:40:17 +02:00
+++ edited/drivers/block/noop-iosched.c	2004-12-24 11:06:18 +01:00
@@ -59,12 +59,10 @@
 void elevator_noop_add_request(request_queue_t *q, struct request *rq,
 			       int where)
 {
-	struct list_head *insert = q->queue_head.prev;
-
 	if (where == ELEVATOR_INSERT_FRONT)
-		insert = &q->queue_head;
-
-	list_add_tail(&rq->queuelist, &q->queue_head);
+		list_add(&rq->queuelist, &q->queue_head);
+	else
+		list_add_tail(&rq->queuelist, &q->queue_head);
 
 	/*
 	 * new merges must not precede this barrier

Signed-off-by: Jens Axboe <axboe@suse.de>

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-12-24 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-23 16:01 noop insert Shailabh Nagar
2004-12-24 10:07 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox