]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] IDE cleanups (2.5; similar to ones done for other drivers)
authorAlexander Viro <viro@math.psu.edu>
Wed, 4 Sep 2002 10:15:18 +0000 (03:15 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 4 Sep 2002 10:15:18 +0000 (03:15 -0700)
OK, before the next bunch of gendisk merges, here comes a couple
of 2.5 IDE cleanups.

a) exclusion between rereading partition tables and open() is done
in fs/block_dev.c these days, so homegrown one in ide.c is redundant - that
code _never_ blocks now.  Removed, just as it had been done with counterparts
in other drivers.

b) blk_ioctl() calls are done in blkdev_ioctl() now; driver doesn't
need to handle them.  Again, removed as it had been done in all other drivers.

drivers/ide/ide.c
include/linux/ide.h

index c81cbf3ae916a47b93ec0e634483797610f3fb4c..8d35d74687a38d2f8ba6c89b6ce3d4cbf14060be 100644 (file)
@@ -275,7 +275,6 @@ static void init_hwif_data (unsigned int index)
                drive->name[1]                  = 'd';
                drive->name[2]                  = 'a' + (index * MAX_DRIVES) + unit;
                drive->max_failures             = IDE_DEFAULT_MAX_FAILURES;
-               init_waitqueue_head(&drive->wqueue);
                INIT_LIST_HEAD(&drive->list);
        }
 }
@@ -1805,8 +1804,6 @@ static int ide_open (struct inode * inode, struct file * filp)
 #endif /* defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI) */
        }
 #endif /* CONFIG_KMOD */
-       while (drive->busy)
-               sleep_on(&drive->wqueue);
        drive->usage++;
        if (drive->driver != NULL)
                return DRIVER(drive)->open(inode, filp, drive);
@@ -1877,7 +1874,7 @@ struct seq_operations ide_drivers_op = {
  */
 int ide_replace_subdriver (ide_drive_t *drive, const char *driver)
 {
-       if (!drive->present || drive->busy || drive->usage)
+       if (!drive->present || drive->usage)
                goto abort;
        if (drive->driver != NULL && DRIVER(drive)->cleanup(drive))
                goto abort;
@@ -1961,7 +1958,7 @@ void ide_unregister (unsigned int index)
                drive = &hwif->drives[unit];
                if (!drive->present)
                        continue;
-               if (drive->busy || drive->usage)
+               if (drive->usage)
                        goto abort;
                if (drive->driver != NULL && DRIVER(drive)->cleanup(drive))
                        goto abort;
@@ -2653,18 +2650,6 @@ static int ide_ioctl (struct inode *inode, struct file *file,
                        }
                        return 0;
                }
-               case BLKGETSIZE:
-               case BLKGETSIZE64:
-               case BLKROSET:
-               case BLKROGET:
-               case BLKFLSBUF:
-               case BLKSSZGET:
-               case BLKPG:
-               case BLKELVGET:
-               case BLKELVSET:
-               case BLKBSZGET:
-               case BLKBSZSET:
-                       return blk_ioctl(inode->i_bdev, cmd, arg);
 
                case CDROMEJECT:
                case CDROMCLOSETRAY:
@@ -3434,7 +3419,7 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
        
        spin_lock_irqsave(&ide_lock, flags);
        if (version != IDE_SUBDRIVER_VERSION || !drive->present ||
-           drive->driver != NULL || drive->busy || drive->usage) {
+           drive->driver != NULL || drive->usage) {
                spin_unlock_irqrestore(&ide_lock, flags);
                return 1;
        }
@@ -3463,8 +3448,7 @@ int ide_unregister_subdriver (ide_drive_t *drive)
        unsigned long flags;
        
        spin_lock_irqsave(&ide_lock, flags);
-       if (drive->usage || drive->busy ||
-           drive->driver == NULL || DRIVER(drive)->busy) {
+       if (drive->usage || drive->driver == NULL || DRIVER(drive)->busy) {
                spin_unlock_irqrestore(&ide_lock, flags);
                return 1;
        }
index aacdaad8f594b57f908809049fa158380609e293..98a2db1db3974c584006b098f97dc231197c213f 100644 (file)
@@ -464,7 +464,6 @@ typedef struct ide_drive_s {
        byte     nice1;                 /* flag: give potential excess bandwidth */
        unsigned present        : 1;    /* drive is physically present */
        unsigned noprobe        : 1;    /* from:  hdx=noprobe */
-       unsigned busy           : 1;    /* currently doing revalidate_disk() */
        unsigned removable      : 1;    /* 1 if need to do check_media_change */
        unsigned forced_geom    : 1;    /* 1 if hdx=c,h,s was given at boot */
        unsigned no_unmask      : 1;    /* disallow setting unmask bit */
@@ -506,7 +505,6 @@ typedef struct ide_drive_s {
        unsigned long long capacity48;  /* total number of sectors */
        unsigned int    drive_data;     /* for use by tuneproc/selectproc as needed */
        struct hwif_s     *hwif;        /* actually (ide_hwif_t *) */
-       wait_queue_head_t wqueue;       /* used to wait for drive in open() */
        struct hd_driveid *id;          /* drive model identification info */
        struct hd_struct  *part;        /* drive partition table */
        char            name[4];        /* drive name, such as "hda" */