Lines Matching refs:drive
13 struct drive drive; in CgptLegacy() local
20 if (CGPT_OK != DriveOpen(params->drive_name, &drive, O_RDWR, in CgptLegacy()
24 if (GPT_SUCCESS != (gpt_retval = GptValidityCheck(&drive.gpt))) { in CgptLegacy()
30 h1 = (GptHeader *)drive.gpt.primary_header; in CgptLegacy()
31 h2 = (GptHeader *)drive.gpt.secondary_header; in CgptLegacy()
33 drive.gpt.ignored = MASK_NONE; in CgptLegacy()
36 RepairEntries(&drive.gpt, MASK_SECONDARY); in CgptLegacy()
37 drive.gpt.modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1 | in CgptLegacy()
40 if (!(drive.gpt.valid_headers & MASK_SECONDARY) || in CgptLegacy()
41 !(drive.gpt.valid_entries & MASK_SECONDARY) || in CgptLegacy()
42 drive.gpt.ignored & MASK_SECONDARY) { in CgptLegacy()
49 drive.gpt.modified |= GPT_MODIFIED_HEADER1; in CgptLegacy()
53 memset(drive.gpt.primary_entries, 0, drive.gpt.sector_bytes); in CgptLegacy()
54 drive.gpt.modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1 | in CgptLegacy()
58 UpdateCrc(&drive.gpt); in CgptLegacy()
61 return DriveClose(&drive, 1); in CgptLegacy()
64 (void) DriveClose(&drive, 0); in CgptLegacy()