Lines Matching refs:ph
67 static bool ldm_parse_privhead(const u8 *data, struct privhead *ph) in ldm_parse_privhead() argument
71 BUG_ON(!data || !ph); in ldm_parse_privhead()
77 ph->ver_major = get_unaligned_be16(data + 0x000C); in ldm_parse_privhead()
78 ph->ver_minor = get_unaligned_be16(data + 0x000E); in ldm_parse_privhead()
79 ph->logical_disk_start = get_unaligned_be64(data + 0x011B); in ldm_parse_privhead()
80 ph->logical_disk_size = get_unaligned_be64(data + 0x0123); in ldm_parse_privhead()
81 ph->config_start = get_unaligned_be64(data + 0x012B); in ldm_parse_privhead()
82 ph->config_size = get_unaligned_be64(data + 0x0133); in ldm_parse_privhead()
84 if (ph->ver_major == 2 && ph->ver_minor == 12) in ldm_parse_privhead()
86 if (!is_vista && (ph->ver_major != 2 || ph->ver_minor != 11)) { in ldm_parse_privhead()
88 " Aborting.", ph->ver_major, ph->ver_minor); in ldm_parse_privhead()
91 ldm_debug("PRIVHEAD version %d.%d (Windows %s).", ph->ver_major, in ldm_parse_privhead()
92 ph->ver_minor, is_vista ? "Vista" : "2000/XP"); in ldm_parse_privhead()
93 if (ph->config_size != LDM_DB_SIZE) { /* 1 MiB in sectors. */ in ldm_parse_privhead()
97 (unsigned long long)ph->config_size); in ldm_parse_privhead()
99 if ((ph->logical_disk_size == 0) || (ph->logical_disk_start + in ldm_parse_privhead()
100 ph->logical_disk_size > ph->config_start)) { in ldm_parse_privhead()
104 if (uuid_parse(data + 0x0030, &ph->disk_id)) { in ldm_parse_privhead()
269 struct privhead *ph[3] = { ph1 }; in ldm_validate_privheads() local
278 ph[1] = kmalloc (sizeof (*ph[1]), GFP_KERNEL); in ldm_validate_privheads()
279 ph[2] = kmalloc (sizeof (*ph[2]), GFP_KERNEL); in ldm_validate_privheads()
280 if (!ph[1] || !ph[2]) { in ldm_validate_privheads()
286 ph[0]->config_start = 0; in ldm_validate_privheads()
290 data = read_part_sector(state, ph[0]->config_start + off[i], in ldm_validate_privheads()
296 result = ldm_parse_privhead (data, ph[i]); in ldm_validate_privheads()
309 if ((ph[0]->config_start > num_sects) || in ldm_validate_privheads()
310 ((ph[0]->config_start + ph[0]->config_size) > num_sects)) { in ldm_validate_privheads()
315 if ((ph[0]->logical_disk_start > ph[0]->config_start) || in ldm_validate_privheads()
316 ((ph[0]->logical_disk_start + ph[0]->logical_disk_size) in ldm_validate_privheads()
317 > ph[0]->config_start)) { in ldm_validate_privheads()
322 if (!ldm_compare_privheads (ph[0], ph[1])) { in ldm_validate_privheads()
334 kfree (ph[1]); in ldm_validate_privheads()
335 kfree (ph[2]); in ldm_validate_privheads()
358 struct privhead *ph; in ldm_validate_tocblocks() local
365 ph = &ldb->ph; in ldm_validate_tocblocks()
395 if (((tb[0]->bitmap1_start + tb[0]->bitmap1_size) > ph->config_size) || in ldm_validate_tocblocks()
397 ph->config_size)) { in ldm_validate_tocblocks()
546 if (uuid_equal(&v->vblk.disk.disk_id, &ldb->ph.disk_id)) in ldm_get_disk_objid()
597 put_partition (pp, part_num, ldb->ph.logical_disk_start + in ldm_create_data_partitions()
1459 if (!ldm_validate_privheads(state, &ldb->ph)) in ldm_partition()
1463 base = ldb->ph.config_start; in ldm_partition()