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.
114 pm_identify_partition(int fd, partition_data* partition, void** cookie)
117 if (fd < 0 || !partition || !cookie)
121 "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
122 partition->size, partition->block_size));
124 if (partition->type
125 && !strcmp(partition->type, kPartitionTypeIntelExtended)) {
134 // read the partition structure
135 PartitionMapParser parser(fd, 0, partition->size, partition->block_size);
149 bool hasParent = (get_parent_partition(partition->id) != NULL);
162 // NOTE: It seems supporting nested partition maps makes more trouble than it
170 // else claims the partition, we take it anyway.
179 pm_scan_partition(int fd, partition_data* partition, void* cookie)
182 if (fd < 0 || !partition || !cookie)
186 "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
187 partition->size, partition->block_size));
191 partition->status = B_PARTITION_VALID;
192 partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
193 partition->content_size = partition->size;
197 partition->content_cookie = map;
204 partition_data* child = create_child_partition(partition->id,
205 index, partition->offset + primary->Offset(), primary->Size(),
214 child->block_size = partition->block_size;
238 partition->content_cookie = NULL;
239 for (int32 i = 0; i < partition->child_count; i++) {
240 if (partition_data* child = get_child_partition(partition->id, i))
251 pm_free_identify_partition_cookie(partition_data*/* partition*/, void* cookie)
263 pm_free_partition_cookie(partition_data* partition)
266 // by the partition containing the partition map
267 if (partition)
268 partition->cookie = NULL;
274 pm_free_partition_content_cookie(partition_data* partition)
276 if (partition && partition->content_cookie) {
277 pm_free_identify_partition_cookie(partition, partition->content_cookie);
278 partition->content_cookie = NULL;
302 ep_identify_partition(int fd, partition_data* partition, void** cookie)
305 if (fd < 0 || !partition || !cookie || !partition->cookie)
309 "%" B_PRId32 ")\n", fd, partition->offset, partition->size,
310 partition->block_size));
312 // our parent must be a intel partition map partition and we must have
313 // extended partition type
314 if (!partition->type
315 || strcmp(partition->type, kPartitionTypeIntelExtended)) {
318 partition_data* parent = get_parent_partition(partition->id);
331 ep_scan_partition(int fd, partition_data* partition, void* cookie)
334 if (fd < 0 || !partition || !partition->cookie)
338 "%" B_PRId32 ")\n", fd, partition->offset, partition->size,
339 partition->block_size));
341 partition_data* parent = get_parent_partition(partition->id);
345 PrimaryPartition* primary = (PrimaryPartition*)partition->cookie;
347 partition->status = B_PARTITION_VALID;
348 partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
349 partition->content_size = partition->size;
353 partition->content_cookie = primary;
359 partition_data* child = create_child_partition(partition->id, index,
365 "partition\n"));
369 child->block_size = partition->block_size;
394 partition->content_cookie = NULL;
395 for (int32 i = 0; i < partition->child_count; i++) {
396 if (partition_data* child = get_child_partition(partition->id, i))
406 ep_free_identify_partition_cookie(partition_data* partition, void* cookie)
414 ep_free_partition_cookie(partition_data* partition)
416 // the logical partition's cookie belongs to the partition map partition
417 if (partition)
418 partition->cookie = NULL;
424 ep_free_partition_content_cookie(partition_data* partition)
426 // the extended partition's cookie belongs to the partition map partition
427 if (partition)
428 partition->content_cookie = NULL;
499 // shadow partition modification
587 // shadow partition modification