Lines Matching defs:disk

14  *   - Autodetection of disk format (DD/HD); untested yet, because I
33 * the FDC will otherwise wait forever when no disk is inserted...
37 * - more/other disk formats
42 * - Make disk format numbering independent from minors
48 * - disk formatting
61 * - Maybe a better strategy for disk change detection (does anyone
178 { "D820", 10,1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
226 /* Array for translating minors into disk formats */
268 * Maximum disk size (in kilobytes). This default is used whenever the
269 * current disk size is unknown.
282 * restored upon disk change by floppy_revalidate() if valid (as seen by
292 struct atari_disk_type *disktype; /* current type of disk */
298 disk change detection) */
300 struct gendisk *disk;
339 * of the disk to save read operations. These are two separate buffers
448 static void floppy_release(struct gendisk *disk, fmode_t mode);
505 * clock speed for this disk's type.
583 /* Test again later; if tested too often, it seems there is no disk
585 * at least until a disk is inserted). So we'll test only twice
593 /* This function is repeatedly called to detect disk changes (as good
726 struct request_queue *q = unit[drive].disk->queue;
1036 /* If reading a whole track, wait about one disk rotation and
1155 /* try another disk type */
1157 set_capacity(unit[SelectedDrive].disk,
1172 set_capacity(unit[SelectedDrive].disk,
1342 * FDC status register accessible for check_change. If the last disk
1376 /* If the check for a disk change is done too early after this
1391 /* The detection of disk changes is a dark chapter in Atari history :-(
1398 * filesystem used on the disk and thus the contents of block 0. I've
1399 * chosen the method to always say "The disk was changed" if it is
1401 * invalidates the disk buffers if you work with write protected
1403 * due to unrecognised disk changes.
1406 static unsigned int floppy_check_events(struct gendisk *disk,
1409 struct atari_floppy_struct *p = disk->private_data;
1429 static int floppy_revalidate(struct gendisk *disk)
1431 struct atari_floppy_struct *p = disk->private_data;
1518 set_capacity(floppy->disk, UDT->blocks);
1523 /* user supplied disk type */
1525 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1530 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1536 set_capacity(floppy->disk, UDT->blocks);
1562 struct gendisk *disk = bdev->bd_disk;
1563 struct atari_floppy_struct *floppy = disk->private_data;
1609 * disk change and subsequent revalidate()! simple
1624 if (floppy_check_events(disk, 0))
1625 floppy_revalidate(disk);
1661 set_capacity(floppy->disk, UDT->blocks);
1677 /* no matching disk type found above - setting user_params */
1683 /* set user type (reset by disk change!) */
1705 set_capacity(floppy->disk, UDT->blocks);
1728 set_capacity(floppy->disk, MAX_DISK_SIZE * 2);
1792 * whether a disk is inserted). This is done by issuing a restore
1794 * head across the whole disk) and looking at the state of the "TR00"
1844 * floppies, additionally start the disk-change and motor-off timers.
1939 static void floppy_release(struct gendisk *disk, fmode_t mode)
1941 struct atari_floppy_struct *p = disk->private_data;
1972 return get_disk_and_module(unit[drive].disk);
1988 unit[i].disk = alloc_disk(1);
1989 if (!unit[i].disk) {
1994 unit[i].disk->queue = blk_mq_init_sq_queue(&unit[i].tag_set,
1997 if (IS_ERR(unit[i].disk->queue)) {
1998 put_disk(unit[i].disk);
1999 ret = PTR_ERR(unit[i].disk->queue);
2000 unit[i].disk->queue = NULL;
2030 unit[i].disk->major = FLOPPY_MAJOR;
2031 unit[i].disk->first_minor = i;
2032 sprintf(unit[i].disk->disk_name, "fd%d", i);
2033 unit[i].disk->fops = &floppy_fops;
2034 unit[i].disk->events = DISK_EVENT_MEDIA_CHANGE;
2035 unit[i].disk->private_data = &unit[i];
2036 set_capacity(unit[i].disk, MAX_DISK_SIZE * 2);
2037 add_disk(unit[i].disk);
2052 struct gendisk *disk = unit[i].disk;
2054 blk_cleanup_queue(disk->queue);
2056 put_disk(unit[i].disk);
2107 del_gendisk(unit[i].disk);
2108 blk_cleanup_queue(unit[i].disk->queue);
2110 put_disk(unit[i].disk);