Commit 58da1aad authored by Alexander Viro's avatar Alexander Viro Committed by Andy Grover

[PATCH] dasd fixe and cleanups

dasd.c forgot to set ->private_data, but was using it ;-/  Fixed.

Remaining dasd_devmap_from_kdev() callers switched to
dasd_devmap_from_bdev() (other than call from dasd_devmap_from_bdev(),
that is).

dasd_devmap_from_kdev() merged into dasd_devmap_from_bdev().
parent 1f8547ed
......@@ -244,6 +244,7 @@ dasd_alloc_device(dasd_devmap_t *devmap)
kfree(device);
return (dasd_device_t *) gdp;
}
gdp->private_data = device;
device->gdp = gdp;
dasd_init_chunklist(&device->ccw_chunks, device->ccw_mem, PAGE_SIZE*2);
......@@ -2098,7 +2099,7 @@ dasd_open(struct inode *inp, struct file *filp)
major(inp->i_rdev), minor(inp->i_rdev));
return -EPERM;
}
devmap = dasd_devmap_from_kdev(inp->i_rdev);
devmap = dasd_devmap_from_bdev(inp->i_bdev);
device = (devmap != NULL) ?
dasd_get_device(devmap) : ERR_PTR(-ENODEV);
if (IS_ERR(device)) {
......@@ -2134,7 +2135,7 @@ dasd_release(struct inode *inp, struct file *filp)
dasd_devmap_t *devmap;
dasd_device_t *device;
devmap = dasd_devmap_from_kdev(inp->i_rdev);
devmap = dasd_devmap_from_bdev(inp->i_bdev);
device = (devmap != NULL) ?
dasd_get_device(devmap) : ERR_PTR(-ENODEV);
if (IS_ERR(device)) {
......
......@@ -430,11 +430,12 @@ dasd_devmap_from_irq(int irq)
}
/*
* Find the devmap for a device corresponding to a kdev.
* Find the devmap for a device corresponding to a block_device.
*/
dasd_devmap_t *
dasd_devmap_from_kdev(kdev_t kdev)
dasd_devmap_from_bdev(struct block_device *bdev)
{
kdev_t kdev = to_kdev_t(bdev->bd_dev);
int devindex;
/* Find the devindex for kdev. */
......@@ -448,15 +449,6 @@ dasd_devmap_from_kdev(kdev_t kdev)
return dasd_devmap_from_devindex(devindex);
}
/*
* Find the devmap for a device corresponding to a block_device.
*/
dasd_devmap_t *
dasd_devmap_from_bdev(struct block_device *bdev)
{
return dasd_devmap_from_kdev(to_kdev_t(bdev->bd_dev));
}
/*
* Find the device structure for device number devno. If it does not
* exists yet, allocate it. Increase the reference counter in the device
......@@ -535,6 +527,5 @@ dasd_devmap_exit(void)
EXPORT_SYMBOL(dasd_devmap_from_devno);
EXPORT_SYMBOL(dasd_devmap_from_devindex);
EXPORT_SYMBOL(dasd_devmap_from_irq);
EXPORT_SYMBOL(dasd_devmap_from_kdev);
EXPORT_SYMBOL(dasd_get_device);
EXPORT_SYMBOL(dasd_put_device);
......@@ -464,7 +464,6 @@ void dasd_devmap_exit(void);
dasd_devmap_t *dasd_devmap_from_devno(int);
dasd_devmap_t *dasd_devmap_from_devindex(int);
dasd_devmap_t *dasd_devmap_from_irq(int);
dasd_devmap_t *dasd_devmap_from_kdev(kdev_t);
dasd_devmap_t *dasd_devmap_from_bdev(struct block_device *bdev);
dasd_device_t *dasd_get_device(dasd_devmap_t *);
void dasd_put_device(dasd_devmap_t *);
......
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