diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 72569cc3cbb7..0a868118cf06 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -98,9 +98,9 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data) | |||
98 | 98 | ||
99 | static DEFINE_MUTEX(ubd_lock); | 99 | static DEFINE_MUTEX(ubd_lock); |
100 | 100 | ||
101 | static int ubd_open(struct inode * inode, struct file * filp); | 101 | static int ubd_open(struct block_device *bdev, fmode_t mode); |
102 | static int ubd_release(struct inode * inode, struct file * file); | 102 | static int ubd_release(struct gendisk *disk, fmode_t mode); |
103 | static int ubd_ioctl(struct inode * inode, struct file * file, | 103 | static int ubd_ioctl(struct block_device *bdev, fmode_t mode, |
104 | unsigned int cmd, unsigned long arg); | 104 | unsigned int cmd, unsigned long arg); |
105 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); | 105 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); |
106 | 106 | ||
@@ -108,9 +108,9 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); | |||
108 | 108 | ||
109 | static struct block_device_operations ubd_blops = { | 109 | static struct block_device_operations ubd_blops = { |
110 | .owner = THIS_MODULE, | 110 | .owner = THIS_MODULE, |
111 | .__open = ubd_open, | 111 | .open = ubd_open, |
112 | .__release = ubd_release, | 112 | .release = ubd_release, |
113 | .__ioctl = ubd_ioctl, | 113 | .ioctl = ubd_ioctl, |
114 | .getgeo = ubd_getgeo, | 114 | .getgeo = ubd_getgeo, |
115 | }; | 115 | }; |
116 | 116 | ||
@@ -1112,9 +1112,9 @@ static int __init ubd_driver_init(void){ | |||
1112 | 1112 | ||
1113 | device_initcall(ubd_driver_init); | 1113 | device_initcall(ubd_driver_init); |
1114 | 1114 | ||
1115 | static int ubd_open(struct inode *inode, struct file *filp) | 1115 | static int ubd_open(struct block_device *bdev, fmode_t mode) |
1116 | { | 1116 | { |
1117 | struct gendisk *disk = inode->i_bdev->bd_disk; | 1117 | struct gendisk *disk = bdev->bd_disk; |
1118 | struct ubd *ubd_dev = disk->private_data; | 1118 | struct ubd *ubd_dev = disk->private_data; |
1119 | int err = 0; | 1119 | int err = 0; |
1120 | 1120 | ||
@@ -1131,7 +1131,7 @@ static int ubd_open(struct inode *inode, struct file *filp) | |||
1131 | 1131 | ||
1132 | /* This should no more be needed. And it didn't work anyway to exclude | 1132 | /* This should no more be needed. And it didn't work anyway to exclude |
1133 | * read-write remounting of filesystems.*/ | 1133 | * read-write remounting of filesystems.*/ |
1134 | /*if((filp->f_mode & FMODE_WRITE) && !ubd_dev->openflags.w){ | 1134 | /*if((mode & FMODE_WRITE) && !ubd_dev->openflags.w){ |
1135 | if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev); | 1135 | if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev); |
1136 | err = -EROFS; | 1136 | err = -EROFS; |
1137 | }*/ | 1137 | }*/ |
@@ -1139,9 +1139,8 @@ static int ubd_open(struct inode *inode, struct file *filp) | |||
1139 | return err; | 1139 | return err; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int ubd_release(struct inode * inode, struct file * file) | 1142 | static int ubd_release(struct gendisk *disk, fmode_t mode) |
1143 | { | 1143 | { |
1144 | struct gendisk *disk = inode->i_bdev->bd_disk; | ||
1145 | struct ubd *ubd_dev = disk->private_data; | 1144 | struct ubd *ubd_dev = disk->private_data; |
1146 | 1145 | ||
1147 | if(--ubd_dev->count == 0) | 1146 | if(--ubd_dev->count == 0) |
@@ -1306,10 +1305,10 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
1306 | return 0; | 1305 | return 0; |
1307 | } | 1306 | } |
1308 | 1307 | ||
1309 | static int ubd_ioctl(struct inode * inode, struct file * file, | 1308 | static int ubd_ioctl(struct block_device *bdev, fmode_t mode, |
1310 | unsigned int cmd, unsigned long arg) | 1309 | unsigned int cmd, unsigned long arg) |
1311 | { | 1310 | { |
1312 | struct ubd *ubd_dev = inode->i_bdev->bd_disk->private_data; | 1311 | struct ubd *ubd_dev = bdev->bd_disk->private_data; |
1313 | struct hd_driveid ubd_id = { | 1312 | struct hd_driveid ubd_id = { |
1314 | .cyls = 0, | 1313 | .cyls = 0, |
1315 | .heads = 128, | 1314 | .heads = 128, |