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]; member
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 in fd_motor_off_timer()
598 * at least until a disk is inserted). So we'll test only twice in fd_motor_off_timer()
606 /* This function is repeatedly called to detect disk changes (as good
761 q = unit[drive].disk[type]->queue; in do_format()
1064 /* If reading a whole track, wait about one disk rotation and in fd_rwsec()
1183 /* try another disk type */ in fd_rwsec_done1()
1185 set_capacity(unit[SelectedDrive].disk[0], in fd_rwsec_done1()
1200 set_capacity(unit[SelectedDrive].disk[0], in fd_rwsec_done1()
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 in finish_fdc_done()
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, in floppy_check_events() argument
1439 struct atari_floppy_struct *p = disk->private_data; in floppy_check_events()
1459 static int floppy_revalidate(struct gendisk *disk) in floppy_revalidate() argument
1461 struct atari_floppy_struct *p = disk->private_data; in floppy_revalidate()
1507 struct atari_floppy_struct *floppy = bd->rq->q->disk->private_data; in ataflop_queue_rq()
1544 set_capacity(bd->rq->q->disk, UDT->blocks); in ataflop_queue_rq()
1549 /* user supplied disk type */ in ataflop_queue_rq()
1551 printk(KERN_WARNING "fd%d: invalid disk format", drive ); in ataflop_queue_rq()
1557 printk(KERN_WARNING "fd%d: unsupported disk format", drive ); in ataflop_queue_rq()
1564 set_capacity(bd->rq->q->disk, UDT->blocks); in ataflop_queue_rq()
1588 struct gendisk *disk = bdev->bd_disk; in fd_locked_ioctl() local
1589 struct atari_floppy_struct *floppy = disk->private_data; in fd_locked_ioctl()
1635 * disk change and subsequent revalidate()! simple in fd_locked_ioctl()
1650 if (floppy_check_events(disk, 0)) in fd_locked_ioctl()
1651 floppy_revalidate(disk); in fd_locked_ioctl()
1688 set_capacity(disk, UDT->blocks); in fd_locked_ioctl()
1704 /* no matching disk type found above - setting user_params */ in fd_locked_ioctl()
1710 /* set user type (reset by disk change!) */ in fd_locked_ioctl()
1734 set_capacity(disk, UDT->blocks); in fd_locked_ioctl()
1757 set_capacity(disk, MAX_DISK_SIZE * 2); in fd_locked_ioctl()
1764 if (disk_check_media_change(disk)) { in fd_locked_ioctl()
1765 bdev_mark_dead(disk->part0, true); in fd_locked_ioctl()
1766 floppy_revalidate(disk); in fd_locked_ioctl()
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) in floppy_open() argument
1923 struct atari_floppy_struct *p = disk->private_data; in floppy_open()
1924 int type = disk->first_minor >> 2; in floppy_open()
1943 if (disk_check_media_change(disk)) in floppy_open()
1944 floppy_revalidate(disk); in floppy_open()
1958 static int floppy_unlocked_open(struct gendisk *disk, blk_mode_t mode) in floppy_unlocked_open() argument
1963 ret = floppy_open(disk, mode); in floppy_unlocked_open()
1969 static void floppy_release(struct gendisk *disk) in floppy_release() argument
1971 struct atari_floppy_struct *p = disk->private_data; in floppy_release()
1999 struct gendisk *disk; in ataflop_alloc_disk() local
2001 disk = blk_mq_alloc_disk(&unit[drive].tag_set, &lim, NULL); in ataflop_alloc_disk()
2002 if (IS_ERR(disk)) in ataflop_alloc_disk()
2003 return PTR_ERR(disk); in ataflop_alloc_disk()
2005 disk->major = FLOPPY_MAJOR; in ataflop_alloc_disk()
2006 disk->first_minor = drive + (type << 2); in ataflop_alloc_disk()
2007 disk->minors = 1; in ataflop_alloc_disk()
2008 sprintf(disk->disk_name, "fd%d", drive); in ataflop_alloc_disk()
2009 disk->fops = &floppy_fops; in ataflop_alloc_disk()
2010 disk->flags |= GENHD_FL_NO_PART; in ataflop_alloc_disk()
2011 disk->events = DISK_EVENT_MEDIA_CHANGE; in ataflop_alloc_disk()
2012 disk->private_data = &unit[drive]; in ataflop_alloc_disk()
2013 set_capacity(disk, MAX_DISK_SIZE * 2); in ataflop_alloc_disk()
2015 unit[drive].disk[type] = disk; in ataflop_alloc_disk()
2029 if (unit[drive].disk[type]) in ataflop_probe()
2033 if (add_disk(unit[drive].disk[type])) in ataflop_probe()
2039 put_disk(unit[drive].disk[type]); in ataflop_probe()
2040 unit[drive].disk[type] = NULL; in ataflop_probe()
2050 if (!unit[i].disk[type]) in atari_floppy_cleanup()
2052 del_gendisk(unit[i].disk[type]); in atari_floppy_cleanup()
2053 put_disk(unit[i].disk[type]); in atari_floppy_cleanup()
2067 if (!fs->disk[type]) in atari_cleanup_floppy_disk()
2070 del_gendisk(fs->disk[type]); in atari_cleanup_floppy_disk()
2071 put_disk(fs->disk[type]); in atari_cleanup_floppy_disk()
2128 ret = add_disk(unit[i].disk[0]); in atari_floppy_init()