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);
}
}
#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);
*/
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;
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;
}
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:
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;
}
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;
}
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 */
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" */