Commit e635a53f authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] cpqarray

	* switched to private queues
	* set ->queue and ->private_data
	* switched to new methods
parent 21f713f2
...@@ -150,7 +150,7 @@ static inline void complete_command(cmdlist_t *cmd, int timeout); ...@@ -150,7 +150,7 @@ static inline void complete_command(cmdlist_t *cmd, int timeout);
static void do_ida_intr(int irq, void *dev_id, struct pt_regs * regs); static void do_ida_intr(int irq, void *dev_id, struct pt_regs * regs);
static void ida_timer(unsigned long tdata); static void ida_timer(unsigned long tdata);
static int ida_revalidate(kdev_t dev); static int ida_revalidate(struct gendisk *disk);
static int revalidate_allvol(kdev_t dev); static int revalidate_allvol(kdev_t dev);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
...@@ -163,11 +163,11 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset, ...@@ -163,11 +163,11 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset,
#endif #endif
static struct block_device_operations ida_fops = { static struct block_device_operations ida_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
open: ida_open, .open = ida_open,
release: ida_release, .release = ida_release,
ioctl: ida_ioctl, .ioctl = ida_ioctl,
revalidate: ida_revalidate, .revalidate_disk= ida_revalidate,
}; };
...@@ -296,7 +296,7 @@ static void __exit cpqarray_exit(void) ...@@ -296,7 +296,7 @@ static void __exit cpqarray_exit(void)
iounmap(hba[i]->vaddr); iounmap(hba[i]->vaddr);
unregister_blkdev(MAJOR_NR+i, hba[i]->devname); unregister_blkdev(MAJOR_NR+i, hba[i]->devname);
del_timer(&hba[i]->timer); del_timer(&hba[i]->timer);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR + i)); blk_cleanup_queue(&hba[i]->queue);
remove_proc_entry(hba[i]->devname, proc_array); remove_proc_entry(hba[i]->devname, proc_array);
pci_free_consistent(hba[i]->pci_dev, pci_free_consistent(hba[i]->pci_dev,
NR_CMDS * sizeof(cmdlist_t), (hba[i]->cmd_pool), NR_CMDS * sizeof(cmdlist_t), (hba[i]->cmd_pool),
...@@ -378,7 +378,7 @@ static int __init cpqarray_init(void) ...@@ -378,7 +378,7 @@ static int __init cpqarray_init(void)
ida_procinit(i); ida_procinit(i);
q = BLK_DEFAULT_QUEUE(MAJOR_NR + i); q = &hba[i]->queue;
q->queuedata = hba[i]; q->queuedata = hba[i];
spin_lock_init(&hba[i]->lock); spin_lock_init(&hba[i]->lock);
blk_init_queue(q, do_ida_request, &hba[i]->lock); blk_init_queue(q, do_ida_request, &hba[i]->lock);
...@@ -409,8 +409,10 @@ static int __init cpqarray_init(void) ...@@ -409,8 +409,10 @@ static int __init cpqarray_init(void)
disk->fops = &ida_fops; disk->fops = &ida_fops;
if (!drv->nr_blks) if (!drv->nr_blks)
continue; continue;
(BLK_DEFAULT_QUEUE(MAJOR_NR + i))->hardsect_size = drv->blk_size; hba[i]->queue.hardsect_size = drv->blk_size;
set_capacity(disk, drv->nr_blks); set_capacity(disk, drv->nr_blks);
disk->queue = &hba[i]->queue;
disk->private_data = drv;
add_disk(disk); add_disk(disk);
} }
} }
...@@ -1004,7 +1006,7 @@ static void do_ida_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1004,7 +1006,7 @@ static void do_ida_intr(int irq, void *dev_id, struct pt_regs *regs)
/* /*
* See if we can queue up some more IO * See if we can queue up some more IO
*/ */
do_ida_request(BLK_DEFAULT_QUEUE(MAJOR_NR+h->ctlr)); do_ida_request(&h->queue);
spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags);
} }
...@@ -1446,8 +1448,10 @@ static int revalidate_allvol(kdev_t dev) ...@@ -1446,8 +1448,10 @@ static int revalidate_allvol(kdev_t dev)
drv_info_t *drv = &hba[ctlr]->drv[i]; drv_info_t *drv = &hba[ctlr]->drv[i];
if (!drv->nr_blks) if (!drv->nr_blks)
continue; continue;
(BLK_DEFAULT_QUEUE(MAJOR_NR + ctlr))->hardsect_size = drv->blk_size; hba[ctlr]->queue.hardsect_size = drv->blk_size;
set_capacity(disk, drv->nr_blks); set_capacity(disk, drv->nr_blks);
disk->queue = &hba[ctlr]->queue;
disk->private_data = drv;
add_disk(disk); add_disk(disk);
} }
...@@ -1455,12 +1459,10 @@ static int revalidate_allvol(kdev_t dev) ...@@ -1455,12 +1459,10 @@ static int revalidate_allvol(kdev_t dev)
return 0; return 0;
} }
static int ida_revalidate(kdev_t dev) static int ida_revalidate(struct gendisk *disk)
{ {
int ctlr = major(dev) - MAJOR_NR; drv_info_t *drv = disk->private_data;
int target = DEVICE_NR(dev); set_capacity(disk, drv->nr_blks);
struct gendisk *gdev = ida_gendisk[ctlr][target];
set_capacity(gdev, hba[ctlr]->drv[target].nr_blks);
return 0; return 0;
} }
......
...@@ -105,6 +105,7 @@ struct ctlr_info { ...@@ -105,6 +105,7 @@ struct ctlr_info {
cmdlist_t *cmd_pool; cmdlist_t *cmd_pool;
dma_addr_t cmd_pool_dhandle; dma_addr_t cmd_pool_dhandle;
unsigned long *cmd_pool_bits; unsigned long *cmd_pool_bits;
struct request_queue queue;
spinlock_t lock; spinlock_t lock;
unsigned int Qdepth; unsigned int Qdepth;
...@@ -117,7 +118,7 @@ struct ctlr_info { ...@@ -117,7 +118,7 @@ struct ctlr_info {
unsigned int misc_tflags; unsigned int misc_tflags;
}; };
#define IDA_LOCK(i) ((BLK_DEFAULT_QUEUE(MAJOR_NR + i))->queue_lock) #define IDA_LOCK(i) (&hba[i]->queue)
#endif #endif
......
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