Lines Matching refs:partition

15 // TODO: The implementation is very strict right now. It rejects a partition
16 // completely, if it finds an error in its partition tables. We should see,
17 // what error can be handled gracefully, e.g. by ignoring the partition
18 // descriptor or the whole partition table sector.
100 pm_identify_partition(int fd, partition_data* partition, void** cookie)
103 if (fd < 0 || !partition || !cookie)
107 "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
108 partition->size, partition->block_size));
110 if (partition->type
111 && !strcmp(partition->type, kPartitionTypeIntelExtended)) {
120 // read the partition structure
121 PartitionMapParser parser(fd, 0, partition->size, partition->block_size);
135 bool hasParent = (get_parent_partition(partition->id) != NULL);
148 // NOTE: It seems supporting nested partition maps makes more trouble than it
156 // else claims the partition, we take it anyway.
165 pm_scan_partition(int fd, partition_data* partition, void* cookie)
168 if (fd < 0 || !partition || !cookie)
172 "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
173 partition->size, partition->block_size));
177 partition->status = B_PARTITION_VALID;
178 partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
179 partition->content_size = partition->size;
183 partition->content_cookie = map;
190 partition_data* child = create_child_partition(partition->id,
191 index, partition->offset + primary->Offset(), primary->Size(),
200 child->block_size = partition->block_size;
224 partition->content_cookie = NULL;
225 for (int32 i = 0; i < partition->child_count; i++) {
226 if (partition_data* child = get_child_partition(partition->id, i))
237 pm_free_identify_partition_cookie(partition_data*/* partition*/, void* cookie)
249 pm_free_partition_cookie(partition_data* partition)
252 // by the partition containing the partition map
253 if (partition)
254 partition->cookie = NULL;
260 pm_free_partition_content_cookie(partition_data* partition)
262 if (partition && partition->content_cookie) {
263 pm_free_identify_partition_cookie(partition, partition->content_cookie);
264 partition->content_cookie = NULL;
288 ep_identify_partition(int fd, partition_data* partition, void** cookie)
291 if (fd < 0 || !partition || !cookie || !partition->cookie)
295 "%" B_PRId32 ")\n", fd, partition->offset, partition->size,
296 partition->block_size));
298 // our parent must be a intel partition map partition and we must have
299 // extended partition type
300 if (!partition->type
301 || strcmp(partition->type, kPartitionTypeIntelExtended)) {
304 partition_data* parent = get_parent_partition(partition->id);
317 ep_scan_partition(int fd, partition_data* partition, void* cookie)
320 if (fd < 0 || !partition || !partition->cookie)
324 "%" B_PRId32 ")\n", fd, partition->offset, partition->size,
325 partition->block_size));
327 partition_data* parent = get_parent_partition(partition->id);
331 PrimaryPartition* primary = (PrimaryPartition*)partition->cookie;
333 partition->status = B_PARTITION_VALID;
334 partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
335 partition->content_size = partition->size;
339 partition->content_cookie = primary;
345 partition_data* child = create_child_partition(partition->id, index,
351 "partition\n"));
355 child->block_size = partition->block_size;
380 partition->content_cookie = NULL;
381 for (int32 i = 0; i < partition->child_count; i++) {
382 if (partition_data* child = get_child_partition(partition->id, i))
392 ep_free_identify_partition_cookie(partition_data* partition, void* cookie)
400 ep_free_partition_cookie(partition_data* partition)
402 // the logical partition's cookie belongs to the partition map partition
403 if (partition)
404 partition->cookie = NULL;
410 ep_free_partition_content_cookie(partition_data* partition)
412 // the extended partition's cookie belongs to the partition map partition
413 if (partition)
414 partition->content_cookie = NULL;
485 // shadow partition modification
573 // shadow partition modification