Lines Matching defs:device
50 disk_device_data* device = new disk_device_data;
51 device->id = partition->id;
52 device->path = partition->path;
53 device->flags = 0;
55 if (ioctl(fd, B_GET_GEOMETRY, &device->geometry) < 0) {
60 delete device;
69 device->geometry.bytes_per_sector = blockSize;
70 device->geometry.sectors_per_track = 1;
71 device->geometry.cylinder_count = blocks / heads;
72 device->geometry.head_count = heads;
73 device->geometry.device_type = B_DISK;
74 device->geometry.removable = false;
75 device->geometry.read_only = true;
76 device->geometry.write_once = false;
80 partition->size = 1LL * device->geometry.head_count
81 * device->geometry.cylinder_count * device->geometry.sectors_per_track
82 * device->geometry.bytes_per_sector;
83 partition->block_size = device->geometry.bytes_per_sector;
85 sDiskDevices.insert(std::make_pair(partition->id, device));
100 printf("device ID %ld\n", id);
110 printf(" device type %d\n", data->geometry.device_type);
175 // #pragma mark - disk device manager API
181 // TODO: we could check if the device is properly unlocked again
195 // TODO: we could check if the device is properly unlocked again
364 fprintf(stderr, "usage: %s <device>\n"
379 int device = open(deviceName, O_RDONLY);
380 if (device < 0) {
381 fprintf(stderr, "Could not open device \"%s\": %s\n", deviceName,
387 status_t status = create_disk_device(device, deviceName, &id);
389 fprintf(stderr, "Could not get device size \"%s\": %s\n", deviceName,
395 scan_partition(device, id);
402 close(device);