Lines Matching refs:vh

85 	struct volume_header *vh;
91 vh = (struct volume_header *) label;
93 bool found = PED_BE32_TO_CPU (vh->vh_magic) == VHMAGIC;
307 struct volume_header vh;
320 memcpy (&vh, s0, sizeof vh);
323 if (_checksum ((uint32_t*) &vh, sizeof (struct volume_header))) {
333 PED_ASSERT (PED_BE32_TO_CPU (vh.vh_magic) == VHMAGIC, return 0);
335 dvh_disk_data->dev_params = vh.vh_dp;
336 strncpy (boot_name, vh.vh_bootfile, BFNAMESIZE);
343 if (!vh.vh_pt[i].pt_nblks)
346 if (PED_BE32_TO_CPU (vh.vh_pt[i].pt_type) == PTYPE_VOLUME)
349 part = _parse_partition (disk, &vh.vh_pt[i]);
356 if (PED_BE16_TO_CPU (vh.vh_rootpt) == i)
358 if (PED_BE16_TO_CPU (vh.vh_swappt) == i)
393 if (!vh.vh_vd[i].vd_nbytes)
396 part = _parse_boot_file (disk, &vh.vh_vd[i]);
459 struct volume_header vh;
466 memset (&vh, 0, sizeof (struct volume_header));
468 vh.vh_magic = PED_CPU_TO_BE32 (VHMAGIC);
469 vh.vh_rootpt = PED_CPU_TO_BE16 (dvh_disk_data->root - 1);
470 vh.vh_swappt = PED_CPU_TO_BE16 (dvh_disk_data->swap - 1);
475 strcpy (vh.vh_bootfile, ped_partition_get_name (boot_part));
478 vh.vh_dp = dvh_disk_data->dev_params;
480 vh.vh_dp.dp_cyls
482 vh.vh_dp.dp_trks0 = PED_CPU_TO_BE16 ((short)disk->dev->bios_geom.heads);
483 vh.vh_dp.dp_secs
485 vh.vh_dp.dp_secbytes = PED_CPU_TO_BE16 ((short)disk->dev->sector_size);
490 _generate_partition (part, &vh.vh_pt[i]);
498 vh.vh_pt[PNUM_VOLUME].pt_nblks = PED_CPU_TO_BE32 (disk->dev->length);
499 vh.vh_pt[PNUM_VOLUME].pt_firstlbn = PED_CPU_TO_BE32 (0);
500 vh.vh_pt[PNUM_VOLUME].pt_type = PED_CPU_TO_BE32 (PTYPE_VOLUME);
506 _generate_boot_file (part, &vh.vh_vd[i]);
509 vh.vh_csum = 0;
510 vh.vh_csum = PED_CPU_TO_BE32 (_checksum ((uint32_t*) &vh,
513 return (ptt_write_sector (disk, &vh, sizeof vh)