lkml.org 
[lkml]   [2004]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: noop insert
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.053 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site