Lines Matching full:disk

12  *   - Disk change detection and drive deselecting after motor-off
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
168 /* Disk types: DD, HD, ED */
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
761 q = unit[drive].disk[type]->queue;
1064 /* If reading a whole track, wait about one disk rotation and
1183 /* try another disk type */
1185 set_capacity(unit[SelectedDrive].disk[0],
1200 set_capacity(unit[SelectedDrive].disk[0],
1371 * FDC status register accessible for check_change. If the last disk
1405 /* If the check for a disk change is done too early after this
1421 /* The detection of disk changes is a dark chapter in Atari history :-(
1428 * filesystem used on the disk and thus the contents of block 0. I've
1429 * chosen the method to always say "The disk was changed" if it is
1431 * invalidates the disk buffers if you work with write protected
1433 * due to unrecognised disk changes.
1436 static unsigned int floppy_check_events(struct gendisk *disk,
1439 struct atari_floppy_struct *p = disk->private_data;
1459 static int floppy_revalidate(struct gendisk *disk)
1461 struct atari_floppy_struct *p = disk->private_data;
1507 struct atari_floppy_struct *floppy = bd->rq->q->disk->private_data;
1544 set_capacity(bd->rq->q->disk, UDT->blocks);
1549 /* user supplied disk type */
1551 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1557 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1564 set_capacity(bd->rq->q->disk, UDT->blocks);
1588 struct gendisk *disk = bdev->bd_disk;
1589 struct atari_floppy_struct *floppy = disk->private_data;
1635 * disk change and subsequent revalidate()! simple
1650 if (floppy_check_events(disk, 0))
1651 floppy_revalidate(disk);
1688 set_capacity(disk, UDT->blocks);
1704 /* no matching disk type found above - setting user_params */
1710 /* set user type (reset by disk change!) */
1734 set_capacity(disk, UDT->blocks);
1757 set_capacity(disk, MAX_DISK_SIZE * 2);
1764 if (disk_check_media_change(disk)) {
1765 bdev_mark_dead(disk->part0, true);
1766 floppy_revalidate(disk);
1823 * whether a disk is inserted). This is done by issuing a restore
1825 * head across the whole disk) and looking at the state of the "TR00"
1875 * floppies, additionally start the disk-change and motor-off timers.
1921 static int floppy_open(struct gendisk *disk, blk_mode_t mode)
1923 struct atari_floppy_struct *p = disk->private_data;
1924 int type = disk->first_minor >> 2;
1943 if (disk_check_media_change(disk))
1944 floppy_revalidate(disk);
1958 static int floppy_unlocked_open(struct gendisk *disk, blk_mode_t mode)
1963 ret = floppy_open(disk, mode);
1969 static void floppy_release(struct gendisk *disk)
1971 struct atari_floppy_struct *p = disk->private_data;
1999 struct gendisk *disk;
2001 disk = blk_mq_alloc_disk(&unit[drive].tag_set, &lim, NULL);
2002 if (IS_ERR(disk))
2003 return PTR_ERR(disk);
2005 disk->major = FLOPPY_MAJOR;
2006 disk->first_minor = drive + (type << 2);
2007 disk->minors = 1;
2008 sprintf(disk->disk_name, "fd%d", drive);
2009 disk->fops = &floppy_fops;
2010 disk->flags |= GENHD_FL_NO_PART;
2011 disk->events = DISK_EVENT_MEDIA_CHANGE;
2012 disk->private_data = &unit[drive];
2013 set_capacity(disk, MAX_DISK_SIZE * 2);
2015 unit[drive].disk[type] = disk;
2029 if (unit[drive].disk[type])
2033 if (add_disk(unit[drive].disk[type]))
2039 put_disk(unit[drive].disk[type]);
2040 unit[drive].disk[type] = NULL;
2050 if (!unit[i].disk[type])
2052 del_gendisk(unit[i].disk[type]);
2053 put_disk(unit[i].disk[type]);
2067 if (!fs->disk[type])
2070 del_gendisk(fs->disk[type]);
2071 put_disk(fs->disk[type]);
2128 ret = add_disk(unit[i].disk[0]);