Commit b6a89530 authored by Al Viro's avatar Al Viro

[PATCH] switch pd

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c9acf903
...@@ -728,9 +728,9 @@ static int pd_special_command(struct pd_unit *disk, ...@@ -728,9 +728,9 @@ static int pd_special_command(struct pd_unit *disk,
/* kernel glue structures */ /* kernel glue structures */
static int pd_open(struct inode *inode, struct file *file) static int pd_open(struct block_device *bdev, fmode_t mode)
{ {
struct pd_unit *disk = inode->i_bdev->bd_disk->private_data; struct pd_unit *disk = bdev->bd_disk->private_data;
disk->access++; disk->access++;
...@@ -758,10 +758,10 @@ static int pd_getgeo(struct block_device *bdev, struct hd_geometry *geo) ...@@ -758,10 +758,10 @@ static int pd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
return 0; return 0;
} }
static int pd_ioctl(struct inode *inode, struct file *file, static int pd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct pd_unit *disk = inode->i_bdev->bd_disk->private_data; struct pd_unit *disk = bdev->bd_disk->private_data;
switch (cmd) { switch (cmd) {
case CDROMEJECT: case CDROMEJECT:
...@@ -773,9 +773,9 @@ static int pd_ioctl(struct inode *inode, struct file *file, ...@@ -773,9 +773,9 @@ static int pd_ioctl(struct inode *inode, struct file *file,
} }
} }
static int pd_release(struct inode *inode, struct file *file) static int pd_release(struct gendisk *p, fmode_t mode)
{ {
struct pd_unit *disk = inode->i_bdev->bd_disk->private_data; struct pd_unit *disk = p->private_data;
if (!--disk->access && disk->removable) if (!--disk->access && disk->removable)
pd_special_command(disk, pd_door_unlock); pd_special_command(disk, pd_door_unlock);
...@@ -807,9 +807,9 @@ static int pd_revalidate(struct gendisk *p) ...@@ -807,9 +807,9 @@ static int pd_revalidate(struct gendisk *p)
static struct block_device_operations pd_fops = { static struct block_device_operations pd_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.__open = pd_open, .open = pd_open,
.__release = pd_release, .release = pd_release,
.__ioctl = pd_ioctl, .locked_ioctl = pd_ioctl,
.getgeo = pd_getgeo, .getgeo = pd_getgeo,
.media_changed = pd_check_media, .media_changed = pd_check_media,
.revalidate_disk= pd_revalidate .revalidate_disk= pd_revalidate
......
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