Lines Matching refs:ph
81 static bool ldm_parse_privhead(const u8 *data, struct privhead *ph) in ldm_parse_privhead() argument
85 BUG_ON(!data || !ph); in ldm_parse_privhead()
91 ph->ver_major = get_unaligned_be16(data + 0x000C); in ldm_parse_privhead()
92 ph->ver_minor = get_unaligned_be16(data + 0x000E); in ldm_parse_privhead()
93 ph->logical_disk_start = get_unaligned_be64(data + 0x011B); in ldm_parse_privhead()
94 ph->logical_disk_size = get_unaligned_be64(data + 0x0123); in ldm_parse_privhead()
95 ph->config_start = get_unaligned_be64(data + 0x012B); in ldm_parse_privhead()
96 ph->config_size = get_unaligned_be64(data + 0x0133); in ldm_parse_privhead()
98 if (ph->ver_major == 2 && ph->ver_minor == 12) in ldm_parse_privhead()
100 if (!is_vista && (ph->ver_major != 2 || ph->ver_minor != 11)) { in ldm_parse_privhead()
102 " Aborting.", ph->ver_major, ph->ver_minor); in ldm_parse_privhead()
105 ldm_debug("PRIVHEAD version %d.%d (Windows %s).", ph->ver_major, in ldm_parse_privhead()
106 ph->ver_minor, is_vista ? "Vista" : "2000/XP"); in ldm_parse_privhead()
107 if (ph->config_size != LDM_DB_SIZE) { /* 1 MiB in sectors. */ in ldm_parse_privhead()
111 (unsigned long long)ph->config_size); in ldm_parse_privhead()
113 if ((ph->logical_disk_size == 0) || (ph->logical_disk_start + in ldm_parse_privhead()
114 ph->logical_disk_size > ph->config_start)) { in ldm_parse_privhead()
118 if (uuid_parse(data + 0x0030, &ph->disk_id)) { in ldm_parse_privhead()
283 struct privhead *ph[3] = { ph1 }; in ldm_validate_privheads() local
292 ph[1] = kmalloc (sizeof (*ph[1]), GFP_KERNEL); in ldm_validate_privheads()
293 ph[2] = kmalloc (sizeof (*ph[2]), GFP_KERNEL); in ldm_validate_privheads()
294 if (!ph[1] || !ph[2]) { in ldm_validate_privheads()
300 ph[0]->config_start = 0; in ldm_validate_privheads()
304 data = read_part_sector(state, ph[0]->config_start + off[i], in ldm_validate_privheads()
310 result = ldm_parse_privhead (data, ph[i]); in ldm_validate_privheads()
323 if ((ph[0]->config_start > num_sects) || in ldm_validate_privheads()
324 ((ph[0]->config_start + ph[0]->config_size) > num_sects)) { in ldm_validate_privheads()
329 if ((ph[0]->logical_disk_start > ph[0]->config_start) || in ldm_validate_privheads()
330 ((ph[0]->logical_disk_start + ph[0]->logical_disk_size) in ldm_validate_privheads()
331 > ph[0]->config_start)) { in ldm_validate_privheads()
336 if (!ldm_compare_privheads (ph[0], ph[1])) { in ldm_validate_privheads()
348 kfree (ph[1]); in ldm_validate_privheads()
349 kfree (ph[2]); in ldm_validate_privheads()
372 struct privhead *ph; in ldm_validate_tocblocks() local
379 ph = &ldb->ph; in ldm_validate_tocblocks()
409 if (((tb[0]->bitmap1_start + tb[0]->bitmap1_size) > ph->config_size) || in ldm_validate_tocblocks()
411 ph->config_size)) { in ldm_validate_tocblocks()
560 if (uuid_equal(&v->vblk.disk.disk_id, &ldb->ph.disk_id)) in ldm_get_disk_objid()
611 put_partition (pp, part_num, ldb->ph.logical_disk_start + in ldm_create_data_partitions()
1476 if (!ldm_validate_privheads(state, &ldb->ph)) in ldm_partition()
1480 base = ldb->ph.config_start; in ldm_partition()