Commit 4e999af9 authored by Al Viro's avatar Al Viro

[PATCH] switch tape_block

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 46d74326
...@@ -43,18 +43,18 @@ ...@@ -43,18 +43,18 @@
/* /*
* file operation structure for tape block frontend * file operation structure for tape block frontend
*/ */
static int tapeblock_open(struct inode *, struct file *); static int tapeblock_open(struct block_device *, fmode_t);
static int tapeblock_release(struct inode *, struct file *); static int tapeblock_release(struct gendisk *, fmode_t);
static int tapeblock_ioctl(struct inode *, struct file *, unsigned int, static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int,
unsigned long); unsigned long);
static int tapeblock_medium_changed(struct gendisk *); static int tapeblock_medium_changed(struct gendisk *);
static int tapeblock_revalidate_disk(struct gendisk *); static int tapeblock_revalidate_disk(struct gendisk *);
static struct block_device_operations tapeblock_fops = { static struct block_device_operations tapeblock_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.__open = tapeblock_open, .open = tapeblock_open,
.__release = tapeblock_release, .release = tapeblock_release,
.__ioctl = tapeblock_ioctl, .locked_ioctl = tapeblock_ioctl,
.media_changed = tapeblock_medium_changed, .media_changed = tapeblock_medium_changed,
.revalidate_disk = tapeblock_revalidate_disk, .revalidate_disk = tapeblock_revalidate_disk,
}; };
...@@ -364,13 +364,12 @@ tapeblock_medium_changed(struct gendisk *disk) ...@@ -364,13 +364,12 @@ tapeblock_medium_changed(struct gendisk *disk)
* Block frontend tape device open function. * Block frontend tape device open function.
*/ */
static int static int
tapeblock_open(struct inode *inode, struct file *filp) tapeblock_open(struct block_device *bdev, fmode_t mode)
{ {
struct gendisk * disk; struct gendisk * disk = bdev->bd_disk;
struct tape_device * device; struct tape_device * device;
int rc; int rc;
disk = inode->i_bdev->bd_disk;
device = tape_get_device_reference(disk->private_data); device = tape_get_device_reference(disk->private_data);
if (device->required_tapemarks) { if (device->required_tapemarks) {
...@@ -410,9 +409,8 @@ tapeblock_open(struct inode *inode, struct file *filp) ...@@ -410,9 +409,8 @@ tapeblock_open(struct inode *inode, struct file *filp)
* we just get the pointer here and release the reference. * we just get the pointer here and release the reference.
*/ */
static int static int
tapeblock_release(struct inode *inode, struct file *filp) tapeblock_release(struct gendisk *disk, fmode_t mode)
{ {
struct gendisk *disk = inode->i_bdev->bd_disk;
struct tape_device *device = disk->private_data; struct tape_device *device = disk->private_data;
tape_state_set(device, TS_IN_USE); tape_state_set(device, TS_IN_USE);
...@@ -427,22 +425,21 @@ tapeblock_release(struct inode *inode, struct file *filp) ...@@ -427,22 +425,21 @@ tapeblock_release(struct inode *inode, struct file *filp)
*/ */
static int static int
tapeblock_ioctl( tapeblock_ioctl(
struct inode * inode, struct block_device * bdev,
struct file * file, fmode_t mode,
unsigned int command, unsigned int command,
unsigned long arg unsigned long arg
) { ) {
int rc; int rc;
int minor; int minor;
struct gendisk *disk; struct gendisk *disk = bdev->bd_disk;
struct tape_device *device; struct tape_device *device;
rc = 0; rc = 0;
disk = inode->i_bdev->bd_disk;
BUG_ON(!disk); BUG_ON(!disk);
device = disk->private_data; device = disk->private_data;
BUG_ON(!device); BUG_ON(!device);
minor = iminor(inode); minor = MINOR(bdev->bd_dev);
DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command);
DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor);
......
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