Lines Matching defs:device

61 #  define HDIO_GETGEO	0x0301	/* get device geometry */
73 # define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size */
147 char *device;
179 /* Adjust device driver parameters. This function should be called just
180 after successfully opening the device. For now, it simply prevents the
338 grub_util_error ("unaligned device size (nr = 0x%llx, log_sector_size = 0x%x)", nr, log_sector_size);
347 # warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal."
385 size = grub_util_get_disk_size (map[drive].device);
388 grub_util_error (_("unaligned device size"));
400 fd = open (map[drive].device, O_RDONLY);
402 return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device);
527 /* If any device-mapper operation fails, we fall back silently to
807 strcpy (dev, map[disk->id].device);
809 && strncmp (map[disk->id].device, "/dev/", 5) == 0)
815 grub_dprintf ("hostdisk", "reusing open device `%s'\n", dev);
837 grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev);
872 if (data->dev && strcmp (data->dev, map[disk->id].device) == 0 &&
875 grub_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev);
895 fd = open (map[disk->id].device, flags);
898 data->dev = xstrdup (map[disk->id].device);
916 fd = open(map[disk->id].device, flags | O_SHLOCK);
921 grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device);
930 if (grub_util_fd_seek (fd, map[disk->id].device,
1029 grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s'", map[disk->id].device);
1040 grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device);
1074 grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device);
1143 grub_util_info (_("no device.map"));
1222 map[drive].device = xmalloc (PATH_MAX);
1223 if (! realpath (p, map[drive].device))
1228 map[drive].device = xstrdup (p);
1250 if (map[i].device)
1251 free (map[i].device);
1252 map[i].drive = map[i].device = NULL;
1468 /* If this is a Xen virtual block device. */
1480 /* If this is a DM-RAID device.
1558 /* Counter-intuitively, device-mapper refers to the disk-like
1559 device containing a DM-RAID partition device as a "child" of
1560 the partition device. */
1654 strncmp ("fd", path + sizeof("/dev/r") - 1, sizeof("fd") - 1) != 0) /* not a floppy device name */
1676 /* To get the whole disk device from a slice, change the s<N>[<N>] to p0 */
1752 /* Try to determine whether a given device name corresponds to a whole disk.
1755 value is 0 then the device name does not correspond to a whole disk. */
1806 if (! map[i].device)
1808 else if (strcmp (map[i].device, os_disk) == 0)
1821 grub_util_error (_("device count exceeds limit"));
1823 map[i].device = os_disk;
1931 * different, we know that os_dev cannot be a floppy device. */
1946 grub_util_info ("opening the device %s", name);
1953 checked the device map above, we can only get
1961 ("disk does not exist, so falling back to partition device %s",
2133 grub_util_info ("opening the device %s", name);
2166 grub_util_info("Making device name: drive=%d, dos_part=%d, slice=%d",
2174 "Cannot handle device `%s'", os_dev);
2195 return map[disk->id].device;
2207 fd = open (map[disk->id].device, O_RDONLY);
2231 if (map[disk->id].device[5] == 'f'
2232 && map[disk->id].device[6] == 'd'
2233 && map[disk->id].device[7] >= '0'
2234 && map[disk->id].device[7] <= '9')