Commit 61320eeb authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] aztcd.c

	* switched to private queue
	* set ->queue
	* switched to new methods
parent bee3b2c5
......@@ -168,8 +168,7 @@
#include <linux/version.h>
#define MAJOR_NR AZTECH_CDROM_MAJOR
#define DEVICE_NR(device) (minor(device))
#define QUEUE (&azt_queue)
#include <linux/blk.h>
#include "aztcd.h"
......@@ -227,10 +226,11 @@
#define AZT_DEBUG_MULTISESSION
#endif
static struct request_queue azt_queue;
static int current_valid(void)
{
return !blk_queue_empty(QUEUE) &&
major(CURRENT->rq_dev) == MAJOR_NR &&
CURRENT->cmd == READ &&
CURRENT->sector != -1;
}
......@@ -329,7 +329,7 @@ static int aztGetMultiDiskInfo(void);
static int aztGetToc(int multi);
/* Kernel Interface Functions */
static int check_aztcd_media_change(kdev_t full_dev);
static int check_aztcd_media_change(struct gendisk *disk);
static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
unsigned long arg);
static int aztcd_open(struct inode *ip, struct file *fp);
......@@ -340,7 +340,7 @@ static struct block_device_operations azt_fops = {
.open = aztcd_open,
.release = aztcd_release,
.ioctl = aztcd_ioctl,
.check_media_change = check_aztcd_media_change,
.media_changed = check_aztcd_media_change,
};
/* Aztcd State Machine: Controls Drive Operating State */
......@@ -790,7 +790,7 @@ static int aztGetQChannelInfo(struct azt_Toc *qp)
/*
* Read the table of contents (TOC) and TOC header if necessary
*/
static int aztUpdateToc()
static int aztUpdateToc(void)
{
int st;
......@@ -1141,7 +1141,7 @@ __setup("aztcd=", aztcd_setup);
/*
* Checking if the media has been changed
*/
static int check_aztcd_media_change(kdev_t full_dev)
static int check_aztcd_media_change(struct gendisk *disk)
{
if (aztDiskChanged) { /* disk changed */
aztDiskChanged = 0;
......@@ -1677,8 +1677,8 @@ static int aztcd_release(struct inode *inode, struct file *file)
{
#ifdef AZT_DEBUG
printk("aztcd: executing aztcd_release\n");
printk("inode: %p, inode->i_rdev: %x file: %p\n", inode,
inode->i_rdev, file);
printk("inode: %p, device: %s file: %p\n", inode,
inode->i_bdev->bd_disk->disk_name, file);
#endif
if (!--azt_open_count) {
azt_invalidate_buffers();
......@@ -1917,12 +1917,13 @@ static int __init aztcd_init(void)
ret = -EIO;
goto err_out3;
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_aztcd_request, &aztSpin);
blk_queue_hardsect_size(BLK_DEFAULT_QUEUE(MAJOR_NR), 2048);
blk_init_queue(&azt_queue, do_aztcd_request, &aztSpin);
blk_queue_hardsect_size(&azt_queue, 2048);
azt_disk->major = MAJOR_NR;
azt_disk->first_minor = 0;
azt_disk->fops = &azt_fops;
sprintf(azt_disk->disk_name, "aztcd");
azt_disk->queue = &azt_queue;
add_disk(azt_disk);
azt_invalidate_buffers();
......@@ -1952,7 +1953,7 @@ static void __exit aztcd_exit(void)
printk("What's that: can't unregister aztcd\n");
return;
}
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
blk_cleanup_queue(&azt_queue);
if ((azt_port == 0x1f0) || (azt_port == 0x170)) {
SWITCH_IDE_MASTER;
release_region(azt_port, 8); /*IDE-interface */
......
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