Lines Matching refs:sector_bytes

65                 const uint64_t sector_bytes,  in Load()  argument
71 if (!sector_count || !sector_bytes) { in Load()
73 __FUNCTION__, __LINE__, sector_count, sector_bytes); in Load()
77 if (sector_bytes > (UINT64_MAX / sector_count)) { in Load()
79 __FUNCTION__, __LINE__, sector_count, sector_bytes); in Load()
82 count = sector_bytes * sector_count; in Load()
86 if (-1 == lseek(drive->fd, sector * sector_bytes, SEEK_SET)) { in Load()
130 const uint64_t sector_bytes, in Save() argument
136 count = sector_bytes * sector_count; in Save()
138 if (-1 == lseek(drive->fd, sector * sector_bytes, SEEK_SET)) in Save()
148 static int GptLoad(struct drive *drive, uint32_t sector_bytes) { in GptLoad() argument
149 drive->gpt.sector_bytes = sector_bytes; in GptLoad()
150 if (drive->size % drive->gpt.sector_bytes) { in GptLoad()
152 (long long unsigned int)drive->size, drive->gpt.sector_bytes); in GptLoad()
155 drive->gpt.streaming_drive_sectors = drive->size / drive->gpt.sector_bytes; in GptLoad()
165 drive->gpt.sector_bytes, GPT_HEADER_SECTORS)) { in GptLoad()
171 drive->gpt.sector_bytes, GPT_HEADER_SECTORS)) { in GptLoad()
181 drive->gpt.sector_bytes, in GptLoad()
195 drive->gpt.sector_bytes, in GptLoad()
211 drive->gpt.sector_bytes, GPT_HEADER_SECTORS)) { in GptSave()
220 drive->gpt.sector_bytes, GPT_HEADER_SECTORS)) { in GptSave()
229 drive->gpt.sector_bytes, in GptSave()
239 drive->gpt.sector_bytes, in GptSave()
265 static int ObtainDriveSize(int fd, uint64_t* size, uint32_t* sector_bytes) { in ObtainDriveSize() argument
275 if (ioctl(fd, BLKSSZGET, sector_bytes) < 0) { in ObtainDriveSize()
279 *sector_bytes = 512; /* bytes */ in ObtainDriveSize()
283 *sector_bytes = 512; /* bytes */ in ObtainDriveSize()
291 uint32_t sector_bytes; in DriveOpen() local
309 sector_bytes = 512; in DriveOpen()
311 if (ObtainDriveSize(drive->fd, &gpt_drive_size, &sector_bytes) != 0) { in DriveOpen()
317 drive->gpt.gpt_drive_sectors = gpt_drive_size / sector_bytes; in DriveOpen()
327 if (GptLoad(drive, sector_bytes)) { in DriveOpen()