Commit 288ed82d authored by Alexander Viro's avatar Alexander Viro Committed by James Bottomley

[PATCH] removed a bunch of gratuitous ->rq_dev uses

parent d5f24b98
...@@ -1209,8 +1209,8 @@ static void redo_fd_request(void) ...@@ -1209,8 +1209,8 @@ static void redo_fd_request(void)
int device, drive, type; int device, drive, type;
struct archy_floppy_struct *floppy; struct archy_floppy_struct *floppy;
DPRINT(("redo_fd_request: CURRENT=%08lx CURRENT->rq_dev=%04x CURRENT->sector=%ld\n", DPRINT(("redo_fd_request: CURRENT=%p dev=%s CURRENT->sector=%ld\n",
(unsigned long) CURRENT, CURRENT ? CURRENT->rq_dev : 0, CURRENT, CURRENT ? CURRENT->rq_disk->disk_name : "",
!blk_queue_empty(QUEUE) ? CURRENT->sector : 0)); !blk_queue_empty(QUEUE) ? CURRENT->sector : 0));
repeat: repeat:
...@@ -1218,13 +1218,6 @@ static void redo_fd_request(void) ...@@ -1218,13 +1218,6 @@ static void redo_fd_request(void)
if (blk_queue_empty(QUEUE)) if (blk_queue_empty(QUEUE))
goto the_end; goto the_end;
if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
if (CURRENT->bh) {
if (!buffer_locked(CURRENT->bh))
panic(DEVICE_NAME ": block not locked");
}
device = minor(CURRENT->rq_dev); device = minor(CURRENT->rq_dev);
drive = device & 3; drive = device & 3;
type = device >> 2; type = device >> 2;
......
...@@ -1440,8 +1440,8 @@ static void redo_fd_request(void) ...@@ -1440,8 +1440,8 @@ static void redo_fd_request(void)
{ {
int device, drive, type; int device, drive, type;
DPRINT(("redo_fd_request: CURRENT=%08lx CURRENT->dev=%04x CURRENT->sector=%ld\n", DPRINT(("redo_fd_request: CURRENT=%p dev=%s CURRENT->sector=%ld\n",
(unsigned long)CURRENT, !blk_queue_empty(QUEUE) ? CURRENT->rq_dev : 0, CURRENT, !blk_queue_empty(QUEUE) ? CURRENT->rq_disk->disk_name : "",
!blk_queue_empty(QUEUE) ? CURRENT->sector : 0 )); !blk_queue_empty(QUEUE) ? CURRENT->sector : 0 ));
IsFormatting = 0; IsFormatting = 0;
...@@ -1451,9 +1451,6 @@ static void redo_fd_request(void) ...@@ -1451,9 +1451,6 @@ static void redo_fd_request(void)
if (blk_queue_empty(QUEUE)) if (blk_queue_empty(QUEUE))
goto the_end; goto the_end;
if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
device = minor(CURRENT->rq_dev); device = minor(CURRENT->rq_dev);
drive = device & 3; drive = device & 3;
type = device >> 2; type = device >> 2;
......
...@@ -799,23 +799,13 @@ static void do_ida_request(request_queue_t *q) ...@@ -799,23 +799,13 @@ static void do_ida_request(request_queue_t *q)
if (creq->nr_phys_segments > SG_MAX) if (creq->nr_phys_segments > SG_MAX)
BUG(); BUG();
if (h->ctlr != major(creq->rq_dev)-MAJOR_NR || h->ctlr > nr_ctlr)
{
printk(KERN_WARNING "doreq cmd for %d, %x at %p\n",
h->ctlr, minor(creq->rq_dev), creq);
blkdev_dequeue_request(creq);
complete_buffers(creq->bio, 0);
end_that_request_last(creq);
goto startio;
}
if ((c = cmd_alloc(h,1)) == NULL) if ((c = cmd_alloc(h,1)) == NULL)
goto startio; goto startio;
blkdev_dequeue_request(creq); blkdev_dequeue_request(creq);
c->ctlr = h->ctlr; c->ctlr = h->ctlr;
c->hdr.unit = minor(creq->rq_dev) >> NWD_SHIFT; c->hdr.unit = (drv_info_t *)(creq->rq_disk->private_data) - h->drv;
c->hdr.size = sizeof(rblk_t) >> 2; c->hdr.size = sizeof(rblk_t) >> 2;
c->size += sizeof(rblk_t); c->size += sizeof(rblk_t);
......
...@@ -492,9 +492,9 @@ static void do_ps2esdi_request(request_queue_t * q) ...@@ -492,9 +492,9 @@ static void do_ps2esdi_request(request_queue_t * q)
req = elv_next_request(q); req = elv_next_request(q);
#if 0 #if 0
printk("%s:got request. device : %d minor : %d command : %d sector : %ld count : %ld, buffer: %p\n", printk("%s:got request. device : %s command : %d sector : %ld count : %ld, buffer: %p\n",
DEVICE_NAME, DEVICE_NAME,
DEVICE_NR(req->rq_dev), minor(req->rq_dev), req->rq_disk->disk_name,
req->cmd, req->sector, req->cmd, req->sector,
req->current_nr_sectors, req->buffer); req->current_nr_sectors, req->buffer);
#endif #endif
......
...@@ -523,13 +523,11 @@ static void start_request(struct floppy_state *fs) ...@@ -523,13 +523,11 @@ static void start_request(struct floppy_state *fs)
return; return;
} }
while (!blk_queue_empty(QUEUE) && fs->state == idle) { while (!blk_queue_empty(QUEUE) && fs->state == idle) {
if (MAJOR(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
if (CURRENT->bh && !buffer_locked(CURRENT->bh)) if (CURRENT->bh && !buffer_locked(CURRENT->bh))
panic(DEVICE_NAME ": block not locked"); panic(DEVICE_NAME ": block not locked");
#if 0 #if 0
printk("do_fd_req: dev=%x cmd=%d sec=%ld nr_sec=%ld buf=%p\n", printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
kdev_t_to_nr(CURRENT->rq_dev), CURRENT->cmd, CURRENT->rq_disk->disk_name, CURRENT->cmd,
CURRENT->sector, CURRENT->nr_sectors, CURRENT->buffer); CURRENT->sector, CURRENT->nr_sectors, CURRENT->buffer);
printk(" rq_status=%d errors=%d current_nr_sectors=%ld\n", printk(" rq_status=%d errors=%d current_nr_sectors=%ld\n",
CURRENT->rq_status, CURRENT->errors, CURRENT->current_nr_sectors); CURRENT->rq_status, CURRENT->errors, CURRENT->current_nr_sectors);
......
...@@ -395,12 +395,10 @@ static void handle_mtdblock_request(void) ...@@ -395,12 +395,10 @@ static void handle_mtdblock_request(void)
while (!blk_queue_empty(&mtd_queue)) { while (!blk_queue_empty(&mtd_queue)) {
struct request *req = elv_next_request(&mtd_queue); struct request *req = elv_next_request(&mtd_queue);
spin_unlock_irq(mtd_queue.queue_lock); spin_unlock_irq(mtd_queue.queue_lock);
mtdblk = mtdblks[minor(req->rq_dev)]; struct mtdblk_dev **p = req->rq_disk->private_data;
mtdblk = *p;
res = 0; res = 0;
if (minor(req->rq_dev) >= MAX_MTD_DEVICES)
panic("handle_mtdblock_request: minor out of bound");
if (! (req->flags & REQ_CMD)) if (! (req->flags & REQ_CMD))
goto end_req; goto end_req;
...@@ -557,6 +555,7 @@ static void mtd_notify_add(struct mtd_info* mtd) ...@@ -557,6 +555,7 @@ static void mtd_notify_add(struct mtd_info* mtd)
mtddisk[mtd->index] = disk; mtddisk[mtd->index] = disk;
set_capacity(disk, mtd->size / 512); set_capacity(disk, mtd->size / 512);
disk->private_data = &mtdblks[mtd->index];
disk->queue = &mtd_queue; disk->queue = &mtd_queue;
add_disk(disk); add_disk(disk);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment