# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.816 -> 1.817 # drivers/block/ll_rw_blk.c 1.126 -> 1.127 # drivers/block/elevator.c 1.31 -> 1.32 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/10/28 axboe@burns.home.kernel.dk 1.817 # Cleanup the last_merge logic. There are two reasons for clearing last_merge # when we are dealing with integrity, and these are: # # o Clear when handing the request to the driver, so we don't merge on # a started request. # # o Clear when a request is taken off the list. This cannot be done from # the driver (above case would already have been hit), but it can happen # when we merge two requests. # # This makes it a lot nicer, it was always peculiar how we cleared in # put_request. # -------------------------------------------- # diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c --- a/drivers/block/elevator.c Mon Oct 28 18:11:33 2002 +++ b/drivers/block/elevator.c Mon Oct 28 18:11:33 2002 @@ -344,6 +344,16 @@ { elevator_t *e = &q->elevator; + /* + * the main clearing point for q->last_merge is on retrieval of + * request by driver (it calls elv_next_request()), but it _can_ + * also happen here if a request is added to the queue but later + * deleted without ever being given to driver (merged with another + * request). + */ + if (&rq->queuelist == q->last_merge) + q->last_merge = NULL; + if (e->elevator_remove_req_fn) e->elevator_remove_req_fn(q, rq); } diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Mon Oct 28 18:11:33 2002 +++ b/drivers/block/ll_rw_blk.c Mon Oct 28 18:11:33 2002 @@ -1509,11 +1509,6 @@ req->q = NULL; req->rl = NULL; - if (q) { - if (q->last_merge == &req->queuelist) - q->last_merge = NULL; - } - /* * Request may not have originated from ll_rw_blk. if not, * it didn't come out of our reserved rq pools