diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-16 10:23:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-21 07:47:30 -0400 |
commit | badf8082c33d18b118d3a6f1b32d5ea6b97d3839 (patch) | |
tree | 0367c5fb192559ca8302a8a4810ab65c895b8162 /drivers/ide | |
parent | 83ff6fe8580a7c834dba4389d742332fff9b9929 (diff) |
[PATCH] switch ide_disk_ops ->ioctl() to sane prototype
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-disk.h | 2 | ||||
-rw-r--r-- | drivers/ide/ide-disk_ioctl.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.h | 4 | ||||
-rw-r--r-- | drivers/ide/ide-floppy_ioctl.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-gd.c | 2 |
5 files changed, 11 insertions, 13 deletions
diff --git a/drivers/ide/ide-disk.h b/drivers/ide/ide-disk.h index b234b0feaf7b..d511dab7c4aa 100644 --- a/drivers/ide/ide-disk.h +++ b/drivers/ide/ide-disk.h | |||
@@ -13,7 +13,7 @@ ide_decl_devset(wcache); | |||
13 | ide_decl_devset(acoustic); | 13 | ide_decl_devset(acoustic); |
14 | 14 | ||
15 | /* ide-disk_ioctl.c */ | 15 | /* ide-disk_ioctl.c */ |
16 | int ide_disk_ioctl(ide_drive_t *, struct inode *, struct file *, unsigned int, | 16 | int ide_disk_ioctl(ide_drive_t *, struct block_device *, fmode_t, unsigned int, |
17 | unsigned long); | 17 | unsigned long); |
18 | 18 | ||
19 | #ifdef CONFIG_IDE_PROC_FS | 19 | #ifdef CONFIG_IDE_PROC_FS |
diff --git a/drivers/ide/ide-disk_ioctl.c b/drivers/ide/ide-disk_ioctl.c index 41832af400d6..7b783dd7c0be 100644 --- a/drivers/ide/ide-disk_ioctl.c +++ b/drivers/ide/ide-disk_ioctl.c | |||
@@ -13,10 +13,9 @@ static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { | |||
13 | { 0 } | 13 | { 0 } |
14 | }; | 14 | }; |
15 | 15 | ||
16 | int ide_disk_ioctl(ide_drive_t *drive, struct inode *inode, struct file *file, | 16 | int ide_disk_ioctl(ide_drive_t *drive, struct block_device *bdev, fmode_t mode, |
17 | unsigned int cmd, unsigned long arg) | 17 | unsigned int cmd, unsigned long arg) |
18 | { | 18 | { |
19 | struct block_device *bdev = inode->i_bdev; | ||
20 | int err; | 19 | int err; |
21 | 20 | ||
22 | err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); | 21 | err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); |
diff --git a/drivers/ide/ide-floppy.h b/drivers/ide/ide-floppy.h index c17124dd6079..6dd2beb48434 100644 --- a/drivers/ide/ide-floppy.h +++ b/drivers/ide/ide-floppy.h | |||
@@ -23,8 +23,8 @@ void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8); | |||
23 | void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *); | 23 | void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *); |
24 | 24 | ||
25 | /* ide-floppy_ioctl.c */ | 25 | /* ide-floppy_ioctl.c */ |
26 | int ide_floppy_ioctl(ide_drive_t *, struct inode *, struct file *, unsigned int, | 26 | int ide_floppy_ioctl(ide_drive_t *, struct block_device *, fmode_t, |
27 | unsigned long); | 27 | unsigned int, unsigned long); |
28 | 28 | ||
29 | #ifdef CONFIG_IDE_PROC_FS | 29 | #ifdef CONFIG_IDE_PROC_FS |
30 | /* ide-floppy_proc.c */ | 30 | /* ide-floppy_proc.c */ |
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c index 5af70a2c9ef8..2bc51ff73fee 100644 --- a/drivers/ide/ide-floppy_ioctl.c +++ b/drivers/ide/ide-floppy_ioctl.c | |||
@@ -241,7 +241,7 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file, | 244 | static int ide_floppy_format_ioctl(ide_drive_t *drive, fmode_t mode, |
245 | unsigned int cmd, void __user *argp) | 245 | unsigned int cmd, void __user *argp) |
246 | { | 246 | { |
247 | switch (cmd) { | 247 | switch (cmd) { |
@@ -250,7 +250,7 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file, | |||
250 | case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY: | 250 | case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY: |
251 | return ide_floppy_get_format_capacities(drive, argp); | 251 | return ide_floppy_get_format_capacities(drive, argp); |
252 | case IDEFLOPPY_IOCTL_FORMAT_START: | 252 | case IDEFLOPPY_IOCTL_FORMAT_START: |
253 | if (!(file->f_mode & FMODE_WRITE)) | 253 | if (!(mode & FMODE_WRITE)) |
254 | return -EPERM; | 254 | return -EPERM; |
255 | return ide_floppy_format_unit(drive, (int __user *)argp); | 255 | return ide_floppy_format_unit(drive, (int __user *)argp); |
256 | case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS: | 256 | case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS: |
@@ -260,10 +260,9 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file, | |||
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode, | 263 | int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev, |
264 | struct file *file, unsigned int cmd, unsigned long arg) | 264 | fmode_t mode, unsigned int cmd, unsigned long arg) |
265 | { | 265 | { |
266 | struct block_device *bdev = inode->i_bdev; | ||
267 | struct ide_atapi_pc pc; | 266 | struct ide_atapi_pc pc; |
268 | void __user *argp = (void __user *)arg; | 267 | void __user *argp = (void __user *)arg; |
269 | int err; | 268 | int err; |
@@ -271,7 +270,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode, | |||
271 | if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) | 270 | if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) |
272 | return ide_floppy_lockdoor(drive, &pc, arg, cmd); | 271 | return ide_floppy_lockdoor(drive, &pc, arg, cmd); |
273 | 272 | ||
274 | err = ide_floppy_format_ioctl(drive, file, cmd, argp); | 273 | err = ide_floppy_format_ioctl(drive, mode, cmd, argp); |
275 | if (err != -ENOTTY) | 274 | if (err != -ENOTTY) |
276 | return err; | 275 | return err; |
277 | 276 | ||
@@ -281,7 +280,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode, | |||
281 | */ | 280 | */ |
282 | if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND) | 281 | if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND) |
283 | err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk, | 282 | err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk, |
284 | file ? file->f_mode : 0, cmd, argp); | 283 | mode, cmd, argp); |
285 | 284 | ||
286 | if (err == -ENOTTY) | 285 | if (err == -ENOTTY) |
287 | err = generic_ide_ioctl(drive, bdev, cmd, arg); | 286 | err = generic_ide_ioctl(drive, bdev, cmd, arg); |
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 66bbb0a22f57..948af08abe23 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -293,7 +293,7 @@ static int ide_gd_ioctl(struct inode *inode, struct file *file, | |||
293 | struct ide_disk_obj *idkp = ide_drv_g(bdev->bd_disk, ide_disk_obj); | 293 | struct ide_disk_obj *idkp = ide_drv_g(bdev->bd_disk, ide_disk_obj); |
294 | ide_drive_t *drive = idkp->drive; | 294 | ide_drive_t *drive = idkp->drive; |
295 | 295 | ||
296 | return drive->disk_ops->ioctl(drive, inode, file, cmd, arg); | 296 | return drive->disk_ops->ioctl(drive, bdev, file ? file->f_mode : 0, cmd, arg); |
297 | } | 297 | } |
298 | 298 | ||
299 | static struct block_device_operations ide_gd_ops = { | 299 | static struct block_device_operations ide_gd_ops = { |