]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] switch ide_disk_ops ->ioctl() to sane prototype
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 16 Oct 2008 14:23:20 +0000 (10:23 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Oct 2008 11:47:30 +0000 (07:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/ide/ide-disk.h
drivers/ide/ide-disk_ioctl.c
drivers/ide/ide-floppy.h
drivers/ide/ide-floppy_ioctl.c
drivers/ide/ide-gd.c
include/linux/ide.h

index b234b0feaf7b2f03c9a180891c97d7f8734f997d..d511dab7c4aacfafce1da38a1409b9d9dcfa54a1 100644 (file)
@@ -13,7 +13,7 @@ ide_decl_devset(wcache);
 ide_decl_devset(acoustic);
 
 /* ide-disk_ioctl.c */
-int ide_disk_ioctl(ide_drive_t *, struct inode *, struct file *, unsigned int,
+int ide_disk_ioctl(ide_drive_t *, struct block_device *, fmode_t, unsigned int,
                   unsigned long);
 
 #ifdef CONFIG_IDE_PROC_FS
index 41832af400d6632797e167acbd895c4eaeff1335..7b783dd7c0bec4bea0da3d1517ff0c3b18f3738f 100644 (file)
@@ -13,10 +13,9 @@ static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = {
 { 0 }
 };
 
-int ide_disk_ioctl(ide_drive_t *drive, struct inode *inode, struct file *file,
+int ide_disk_ioctl(ide_drive_t *drive, struct block_device *bdev, fmode_t mode,
                   unsigned int cmd, unsigned long arg)
 {
-       struct block_device *bdev = inode->i_bdev;
        int err;
 
        err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings);
index c17124dd6079e6b7edfe1bfd3651a167678c5925..6dd2beb4843492586c78d9e117d82f5676e3cc5e 100644 (file)
@@ -23,8 +23,8 @@ void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8);
 void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *);
 
 /* ide-floppy_ioctl.c */
-int ide_floppy_ioctl(ide_drive_t *, struct inode *, struct file *, unsigned int,
-                    unsigned long);
+int ide_floppy_ioctl(ide_drive_t *, struct block_device *, fmode_t,
+                    unsigned int, unsigned long);
 
 #ifdef CONFIG_IDE_PROC_FS
 /* ide-floppy_proc.c */
index 5af70a2c9ef889422c7d6206a54f6fb4ce735fe6..2bc51ff73fee35b3863aea03b7dc6e6bf09bfc9c 100644 (file)
@@ -241,7 +241,7 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
        return 0;
 }
 
-static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
+static int ide_floppy_format_ioctl(ide_drive_t *drive, fmode_t mode,
                                   unsigned int cmd, void __user *argp)
 {
        switch (cmd) {
@@ -250,7 +250,7 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
        case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY:
                return ide_floppy_get_format_capacities(drive, argp);
        case IDEFLOPPY_IOCTL_FORMAT_START:
-               if (!(file->f_mode & FMODE_WRITE))
+               if (!(mode & FMODE_WRITE))
                        return -EPERM;
                return ide_floppy_format_unit(drive, (int __user *)argp);
        case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
@@ -260,10 +260,9 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
        }
 }
 
-int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
-                    struct file *file, unsigned int cmd, unsigned long arg)
+int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
+                    fmode_t mode, unsigned int cmd, unsigned long arg)
 {
-       struct block_device *bdev = inode->i_bdev;
        struct ide_atapi_pc pc;
        void __user *argp = (void __user *)arg;
        int err;
@@ -271,7 +270,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
        if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR)
                return ide_floppy_lockdoor(drive, &pc, arg, cmd);
 
-       err = ide_floppy_format_ioctl(drive, file, cmd, argp);
+       err = ide_floppy_format_ioctl(drive, mode, cmd, argp);
        if (err != -ENOTTY)
                return err;
 
@@ -281,7 +280,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
         */
        if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
                err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk,
-                               file ? file->f_mode : 0, cmd, argp);
+                               mode, cmd, argp);
 
        if (err == -ENOTTY)
                err = generic_ide_ioctl(drive, bdev, cmd, arg);
index 66bbb0a22f57836f305d14b1066e469129a28816..948af08abe2359d846c68f16d279cd294343f8bf 100644 (file)
@@ -293,7 +293,7 @@ static int ide_gd_ioctl(struct inode *inode, struct file *file,
        struct ide_disk_obj *idkp = ide_drv_g(bdev->bd_disk, ide_disk_obj);
        ide_drive_t *drive = idkp->drive;
 
-       return drive->disk_ops->ioctl(drive, inode, file, cmd, arg);
+       return drive->disk_ops->ioctl(drive, bdev, file ? file->f_mode : 0, cmd, arg);
 }
 
 static struct block_device_operations ide_gd_ops = {
index 0d03e83f7194438d4d29d8c886970a7fd16491d4..54525be4b5f87f8d0f43d21a40db8efee2ec10f5 100644 (file)
@@ -474,8 +474,8 @@ struct ide_disk_ops {
        ide_startstop_t (*do_request)(struct ide_drive_s *, struct request *,
                                      sector_t);
        int             (*end_request)(struct ide_drive_s *, int, int);
-       int             (*ioctl)(struct ide_drive_s *, struct inode *,
-                                struct file *, unsigned int, unsigned long);
+       int             (*ioctl)(struct ide_drive_s *, struct block_device *,
+                                fmode_t, unsigned int, unsigned long);
 };
 
 /* ATAPI device flags */