drivers/block/as-iosched.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff -puN drivers/block/as-iosched.c~as-dont-go-BUG-again drivers/block/as-iosched.c --- 25-power4/drivers/block/as-iosched.c~as-dont-go-BUG-again 2003-03-16 22:03:00.000000000 -0800 +++ 25-power4-akpm/drivers/block/as-iosched.c 2003-03-16 22:03:00.000000000 -0800 @@ -163,6 +163,14 @@ enum anticipation_states { /* * per-request data. */ +enum arq_state { + AS_RQ_NEW=0, /* New - not referenced and not on any lists */ + AS_RQ_QUEUED, /* In the request queue. It belongs to the + scheduler */ + AS_RQ_DISPATCHED, /* On the dispatch list. It belongs to the + driver now */ +}; + struct as_rq { /* * rbtree index, key is the starting offset @@ -186,15 +194,7 @@ struct as_rq { struct list_head fifo; unsigned long expires; - unsigned long state; /* debug only */ -}; - -enum arq_states { - AS_RQ_NEW=0, /* New - not referenced and not on any lists */ - AS_RQ_QUEUED, /* In the request queue. It belongs to the - scheduler */ - AS_RQ_DISPATCHED, /* On the dispatch list. It belongs to the - driver now */ + enum arq_state state; /* debug only */ }; #define RQ_DATA(rq) ((struct as_rq *) (rq)->elevator_private) @@ -968,10 +968,10 @@ static void as_remove_dispatched_request list_del_init(&rq->queuelist); if (arq) { - BUG_ON(arq->state != AS_RQ_DISPATCHED); - BUG_ON(ON_RB(&arq->rb_node)); - if (arq->as_io_context) { - WARN_ON(!atomic_read(&arq->as_io_context->nr_dispatched)); + struct as_io_context *aic = arq->as_io_context; + + if (aic) { + WARN_ON(!atomic_read(&aic->nr_dispatched)); atomic_dec(&arq->as_io_context->nr_dispatched); } } _