Lines Matching refs:dskp
55 gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
74 if (drvwrite(dskp, secbuf, slba, 1)) {
84 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) {
91 gptfind(const uuid_t *uuid, struct dsk *dskp, int part)
162 dskp->part = curent + 1;
164 dskp->start = ent->ent_lba_start;
172 gptupdate("primary", dskp, &hdr_primary, table_primary);
176 gptupdate("backup", dskp, &hdr_backup, table_backup);
183 gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
188 if (drvread(dskp, secbuf, hdrlba, 1)) {
212 gptbootfailed(struct dsk *dskp)
221 gptupdate("primary", dskp, &hdr_primary, table_primary);
226 gptupdate("backup", dskp, &hdr_backup, table_backup);
231 gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
261 if (drvwrite(dskp, secbuf, slba, 1)) {
273 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1))
278 gptread_table(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
293 if (drvread(dskp, secbuf, slba, 1)) {
316 gptread(struct dsk *dskp, char *buf)
328 dskp->start = 0;
330 if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 &&
331 gptread_table("primary", dskp, &hdr_primary, table_primary) == 0) {
344 altlba = drvsize(dskp);
350 else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 &&
351 gptread_table("backup", dskp, &hdr_backup, table_backup) == 0) {
370 gptbootconv("primary", dskp, &hdr_primary, table_primary);
372 gptbootconv("backup", dskp, &hdr_backup, table_backup);