Lines Matching refs: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
179 { "D820", 10,1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
227 /* Array for translating minors into disk formats */
269 * Maximum disk size (in kilobytes). This default is used whenever the
270 * current disk size is unknown.
283 * restored upon disk change by floppy_revalidate() if valid (as seen by
293 struct atari_disk_type *disktype; /* current type of disk */
299 disk change detection) */
301 struct gendisk *disk[NUM_DISK_MINORS];
342 * of the disk to save read operations. These are two separate buffers
450 static int floppy_open(struct gendisk *disk, blk_mode_t mode);
451 static void floppy_release(struct gendisk *disk);
518 * clock speed for this disk's type.
596 /* Test again later; if tested too often, it seems there is no disk
598 * at least until a disk is inserted). So we'll test only twice
606 /* This function is repeatedly called to detect disk changes (as good
760 q = unit[drive].disk[type]->queue;
1063 /* If reading a whole track, wait about one disk rotation and
1182 /* try another disk type */
1184 set_capacity(unit[SelectedDrive].disk[0],
1199 set_capacity(unit[SelectedDrive].disk[0],
1370 * FDC status register accessible for check_change. If the last disk
1404 /* If the check for a disk change is done too early after this
1420 /* The detection of disk changes is a dark chapter in Atari history :-(
1427 * filesystem used on the disk and thus the contents of block 0. I've
1428 * chosen the method to always say "The disk was changed" if it is
1430 * invalidates the disk buffers if you work with write protected
1432 * due to unrecognised disk changes.
1435 static unsigned int floppy_check_events(struct gendisk *disk,
1438 struct atari_floppy_struct *p = disk->private_data;
1458 static int floppy_revalidate(struct gendisk *disk)
1460 struct atari_floppy_struct *p = disk->private_data;
1506 struct atari_floppy_struct *floppy = bd->rq->q->disk->private_data;
1543 set_capacity(bd->rq->q->disk, UDT->blocks);
1548 /* user supplied disk type */
1550 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1556 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1563 set_capacity(bd->rq->q->disk, UDT->blocks);
1587 struct gendisk *disk = bdev->bd_disk;
1588 struct atari_floppy_struct *floppy = disk->private_data;
1634 * disk change and subsequent revalidate()! simple
1649 if (floppy_check_events(disk, 0))
1650 floppy_revalidate(disk);
1687 set_capacity(disk, UDT->blocks);
1703 /* no matching disk type found above - setting user_params */
1709 /* set user type (reset by disk change!) */
1733 set_capacity(disk, UDT->blocks);
1756 set_capacity(disk, MAX_DISK_SIZE * 2);
1763 if (disk_check_media_change(disk)) {
1764 bdev_mark_dead(disk->part0, true);
1765 floppy_revalidate(disk);
1822 * whether a disk is inserted). This is done by issuing a restore
1824 * head across the whole disk) and looking at the state of the "TR00"
1874 * floppies, additionally start the disk-change and motor-off timers.
1920 static int floppy_open(struct gendisk *disk, blk_mode_t mode)
1922 struct atari_floppy_struct *p = disk->private_data;
1923 int type = disk->first_minor >> 2;
1942 if (disk_check_media_change(disk))
1943 floppy_revalidate(disk);
1957 static int floppy_unlocked_open(struct gendisk *disk, blk_mode_t mode)
1962 ret = floppy_open(disk, mode);
1968 static void floppy_release(struct gendisk *disk)
1970 struct atari_floppy_struct *p = disk->private_data;
1995 struct gendisk *disk;
1997 disk = blk_mq_alloc_disk(&unit[drive].tag_set, NULL, NULL);
1998 if (IS_ERR(disk))
1999 return PTR_ERR(disk);
2001 disk->major = FLOPPY_MAJOR;
2002 disk->first_minor = drive + (type << 2);
2003 disk->minors = 1;
2004 sprintf(disk->disk_name, "fd%d", drive);
2005 disk->fops = &floppy_fops;
2006 disk->flags |= GENHD_FL_NO_PART;
2007 disk->events = DISK_EVENT_MEDIA_CHANGE;
2008 disk->private_data = &unit[drive];
2009 set_capacity(disk, MAX_DISK_SIZE * 2);
2011 unit[drive].disk[type] = disk;
2025 if (unit[drive].disk[type])
2029 if (add_disk(unit[drive].disk[type]))
2035 put_disk(unit[drive].disk[type]);
2036 unit[drive].disk[type] = NULL;
2046 if (!unit[i].disk[type])
2048 del_gendisk(unit[i].disk[type]);
2049 put_disk(unit[i].disk[type]);
2063 if (!fs->disk[type])
2066 del_gendisk(fs->disk[type]);
2067 put_disk(fs->disk[type]);
2125 ret = add_disk(unit[i].disk[0]);