diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/drivers/block/ll_rw_blk.c linux-2.6.11-ck7/drivers/block/ll_rw_blk.c --- linux-2.6.11-ck6/drivers/block/ll_rw_blk.c 2005-05-01 00:04:20.000000000 +1000 +++ linux-2.6.11-ck7/drivers/block/ll_rw_blk.c 2005-05-01 10:49:01.000000000 +1000 @@ -1509,6 +1509,15 @@ request_queue_t *blk_init_queue(request_ if (blk_init_free_list(q)) goto out_init; + /* + * if caller didn't supply a lock, they get per-queue locking with + * our embedded lock + */ + if (!lock) { + spin_lock_init(&q->__queue_lock); + lock = &q->__queue_lock; + } + q->request_fn = rfn; q->back_merge_fn = ll_back_merge_fn; q->front_merge_fn = ll_front_merge_fn; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/drivers/scsi/scsi_lib.c linux-2.6.11-ck7/drivers/scsi/scsi_lib.c --- linux-2.6.11-ck6/drivers/scsi/scsi_lib.c 2005-05-01 00:04:21.000000000 +1000 +++ linux-2.6.11-ck7/drivers/scsi/scsi_lib.c 2005-05-01 10:49:01.000000000 +1000 @@ -349,9 +349,9 @@ void scsi_device_unbusy(struct scsi_devi shost->host_failed)) scsi_eh_wakeup(shost); spin_unlock(shost->host_lock); - spin_lock(&sdev->sdev_lock); + spin_lock(sdev->request_queue->queue_lock); sdev->device_busy--; - spin_unlock_irqrestore(&sdev->sdev_lock, flags); + spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); } /* @@ -1195,22 +1195,6 @@ static inline int scsi_host_queue_ready( } /* - * Kill requests for a dead device - */ -static void scsi_kill_requests(request_queue_t *q) -{ - struct request *req; - - while ((req = elv_next_request(q)) != NULL) { - blkdev_dequeue_request(req); - req->flags |= REQ_QUIET; - while (end_that_request_first(req, 0, req->nr_sectors)) - ; - end_that_request_last(req); - } -} - -/* * Function: scsi_request_fn() * * Purpose: Main strategy routine for SCSI. @@ -1224,16 +1208,10 @@ static void scsi_kill_requests(request_q static void scsi_request_fn(struct request_queue *q) { struct scsi_device *sdev = q->queuedata; - struct Scsi_Host *shost; + struct Scsi_Host *shost = sdev->host; struct scsi_cmnd *cmd; struct request *req; - if (!sdev) { - printk("scsi: killing requests for dead queue\n"); - scsi_kill_requests(q); - return; - } - if(!get_device(&sdev->sdev_gendev)) /* We must be tearing the block queue down already */ return; @@ -1242,7 +1220,6 @@ static void scsi_request_fn(struct reque * To start with, we keep looping until the queue is empty, or until * the host is no longer able to accept any more requests. */ - shost = sdev->host; while (!blk_queue_plugged(q)) { int rtn; /* @@ -1376,7 +1353,7 @@ struct request_queue *scsi_alloc_queue(s struct Scsi_Host *shost = sdev->host; struct request_queue *q; - q = blk_init_queue(scsi_request_fn, &sdev->sdev_lock); + q = blk_init_queue(scsi_request_fn, NULL); if (!q) return NULL; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/drivers/scsi/scsi_scan.c linux-2.6.11-ck7/drivers/scsi/scsi_scan.c --- linux-2.6.11-ck6/drivers/scsi/scsi_scan.c 2005-03-02 19:30:27.000000000 +1100 +++ linux-2.6.11-ck7/drivers/scsi/scsi_scan.c 2005-05-01 10:49:01.000000000 +1000 @@ -246,7 +246,6 @@ static struct scsi_device *scsi_alloc_sd */ sdev->borken = 1; - spin_lock_init(&sdev->sdev_lock); sdev->request_queue = scsi_alloc_queue(sdev); if (!sdev->request_queue) goto out_free_dev; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/drivers/scsi/scsi_sysfs.c linux-2.6.11-ck7/drivers/scsi/scsi_sysfs.c --- linux-2.6.11-ck6/drivers/scsi/scsi_sysfs.c 2005-05-01 00:04:21.000000000 +1000 +++ linux-2.6.11-ck7/drivers/scsi/scsi_sysfs.c 2005-03-02 19:30:27.000000000 +1100 @@ -178,10 +178,8 @@ void scsi_device_dev_release(struct devi put_device(parent); } - if (sdev->request_queue) { - sdev->request_queue->queuedata = NULL; + if (sdev->request_queue) scsi_free_queue(sdev->request_queue); - } kfree(sdev->inquiry); kfree(sdev); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/include/linux/blkdev.h linux-2.6.11-ck7/include/linux/blkdev.h --- linux-2.6.11-ck6/include/linux/blkdev.h 2005-05-01 00:04:22.000000000 +1000 +++ linux-2.6.11-ck7/include/linux/blkdev.h 2005-05-01 10:49:01.000000000 +1000 @@ -352,8 +352,11 @@ struct request_queue unsigned long queue_flags; /* - * protects queue structures from reentrancy + * protects queue structures from reentrancy. ->__queue_lock should + * _never_ be used directly, it is queue private. always use + * ->queue_lock. */ + spinlock_t __queue_lock; spinlock_t *queue_lock; /* diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/include/scsi/scsi_device.h linux-2.6.11-ck7/include/scsi/scsi_device.h --- linux-2.6.11-ck6/include/scsi/scsi_device.h 2005-03-02 19:30:30.000000000 +1100 +++ linux-2.6.11-ck7/include/scsi/scsi_device.h 2005-05-01 10:49:01.000000000 +1000 @@ -44,7 +44,6 @@ struct scsi_device { struct list_head same_target_siblings; /* just the devices sharing same target id */ volatile unsigned short device_busy; /* commands actually active on low-level */ - spinlock_t sdev_lock; /* also the request queue_lock */ spinlock_t list_lock; struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.11-ck6/Makefile linux-2.6.11-ck7/Makefile --- linux-2.6.11-ck6/Makefile 2005-05-01 00:04:22.000000000 +1000 +++ linux-2.6.11-ck7/Makefile 2005-05-01 10:49:01.000000000 +1000 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = -ck6 +EXTRAVERSION = -ck7 NAME=Cognac Woozy Numbat # *DOCUMENTATION*