Lines Matching defs:disk
252 struct disk_type *disk, *dp;
292 * S0 takes the whole disk except the primary EFI label,
321 disk = (struct disk_type *)zalloc(sizeof (struct disk_type));
330 dp->dtype_next = disk;
332 disk->dtype_next = NULL;
334 disk->vendor = strdup(label->vendor);
335 disk->product = strdup(label->product);
336 disk->revision = strdup(label->revision);
338 if (disk->vendor == NULL ||
339 disk->product == NULL ||
340 disk->revision == NULL) {
341 free(disk->vendor);
342 free(disk->product);
343 free(disk->revision);
344 free(disk);
348 disk->capacity = label->capacity;
352 disk->dtype_plist = part;
360 return (disk);
424 struct disk_info *disk;
431 for (disk = disk_list; disk != NULL; disk = disk->disk_next) {
432 dp = &disk->disk_dkinfo;
437 return (disk);
441 impossible("No DIRECT/VBD/BLKDEV disk info instance\n");
449 * DKIOCGGEOM will fail if disk is EFI labeled. So we hack around
451 * back on disk.
615 struct disk_type *disk;
624 * Get the disk controller info for this disk
634 * Find the ctlr_info for this disk.
639 * Allocate a new disk type for the direct controller.
641 disk = (struct disk_type *)zalloc(sizeof (struct disk_type));
644 * Find the disk_info instance for this disk.
649 * The controller and the disk should match.
654 * Link the disk into the list of disks
663 dp->dtype_next = disk;
665 disk->dtype_next = NULL;
668 * Allocate and initialize the disk name.
670 disk->dtype_asciilabel = alloc_string(disk_name);
673 * Initialize disk geometry info
675 disk->dtype_pcyl = label->dkl_pcyl;
676 disk->dtype_ncyl = label->dkl_ncyl;
677 disk->dtype_acyl = label->dkl_acyl;
678 disk->dtype_nhead = label->dkl_nhead;
679 disk->dtype_nsect = label->dkl_nsect;
680 disk->dtype_rpm = label->dkl_rpm;
684 pt = disk->dtype_plist;
686 disk->dtype_plist = part;
712 ((blkaddr_t)(disk->dtype_nhead *
713 disk->dtype_nsect - apc));
734 * Link the disk to the partition map
738 return (disk);
742 * Get a disk type that has label info. This is used to convert
761 * Auto-sense a scsi disk configuration, ie get the information
763 * ways to auto-sense a scsi disk:
803 * no hope for this disk, so give up.
822 * If the reported capacity is set to zero, then the disk
824 * 0xf's, then this disk is too large. These could only
843 * Extract the disk name for the format.dat override
847 err_print("disk name: `%s`\n", disk_name);
902 struct disk_type *disk;
925 * If the name of this disk appears to be "SUN", use it,
928 * have a SUN disk type of this name that differs
985 * If the disk capacity is > 1TB then simply compute
986 * the CHS values based on the total disk capacity and
1019 * newly developed large sector size disk, we will not rely on
1032 * The sd driver reserves 2 cylinders the backup disk label and
1110 * the end of the disk.
1116 "disk capacity (%llu)\n",
1163 * fields in our disk label. To do this we need to `square
1172 err_print("This disk is too big to label. "
1281 "disk capacity of %llu blocks\n",
1332 * Find an existing disk type defined for this disk.
1335 * is a disk defined with that name, but with a different
1336 * geometry, construct a new generic disk name out of
1338 * finally using, if there's no such disk type defined,
1339 * build a new disk definition.
1341 if ((disk = find_scsi_disk_type(disk_name, label)) == NULL) {
1349 "Changing disk type name from '%s' to '%s'\n", old_name, disk_name);
1356 disk = find_scsi_disk_type(disk_name, label);
1358 if (disk == NULL) {
1359 disk = new_scsi_disk_type(fd, disk_name, label);
1360 if (disk == NULL)
1365 return (disk);
1479 * Find a partition that matches this disk. Capacity
1545 * If current disk type is not a SCSI disk,
1622 * Set the whole disk partition
1690 * Find an existing scsi disk definition by this name,
1720 * Find an existing scsi disk definition by this name,
1773 * disk on this controller, so it must be present.
1807 struct disk_type *disk;
1816 * Get the disk controller info for this disk
1826 * Find the ctlr_info for this disk.
1831 * Allocate a new disk type for the SCSI controller.
1833 disk = (struct disk_type *)zalloc(sizeof (struct disk_type));
1836 * Find the disk_info instance for this disk.
1841 * The controller and the disk should match.
1846 * Link the disk into the list of disks
1850 ctlr->ctlr_ctype->ctype_dlist = disk;
1855 dp->dtype_next = disk;
1857 disk->dtype_next = NULL;
1860 * Allocate and initialize the disk name.
1862 disk->dtype_asciilabel = alloc_string(disk_name);
1865 * Initialize disk geometry info
1867 disk->dtype_pcyl = label->dkl_pcyl;
1868 disk->dtype_ncyl = label->dkl_ncyl;
1869 disk->dtype_acyl = label->dkl_acyl;
1870 disk->dtype_nhead = label->dkl_nhead;
1871 disk->dtype_nsect = label->dkl_nsect;
1872 disk->dtype_rpm = label->dkl_rpm;
1876 * with a know partition for this disk type.
1878 for (part = disk->dtype_plist; part; part = part->pinfo_next) {
1886 * map for this disk.
1891 pt = disk->dtype_plist;
1893 disk->dtype_plist = part;
1918 ((blkaddr32_t)(disk->dtype_nhead *
1919 disk->dtype_nsect - apc));
1943 * Link the disk to the partition map
1947 return (disk);
1952 * Delete a disk type from disk type list.
1958 struct disk_type *dp, *disk;
1970 disk = ctlr->ctype_dlist;
1971 if (disk == disk_type) {
1972 ctlr->ctype_dlist = disk->dtype_next;
1974 free(disk->dtype_plist->etoc);
1975 free(disk->dtype_plist);
1976 free(disk->vendor);
1977 free(disk->product);
1978 free(disk->revision);
1979 free(disk);
1982 for (dp = disk->dtype_next; dp != NULL;
1983 disk = disk->dtype_next, dp = dp->dtype_next) {
1985 disk->dtype_next = dp->dtype_next;
2005 struct disk_info *disk;
2008 for (disk = disk_list; disk != NULL; disk = disk->disk_next) {
2010 dp = &disk->disk_dkinfo;
2015 return (disk);
2019 impossible("No SCSI disk info instance\n");
2031 * Extract the sun name of the disk
2093 * adjust disk geometry.
2094 * This is used when disk reports a disk geometry page having
2264 * For some smaller disk sizes we report geometry that matches those