Lines Matching full:partition

636  * @partition: The slab depot partition
647 int vdo_configure_slab_depot(const struct partition *partition, in vdo_configure_slab_depot() argument
657 __func__, (unsigned long long) partition->count, in vdo_configure_slab_depot()
658 (unsigned long long) partition->offset, in vdo_configure_slab_depot()
662 slab_count = (partition->count / slab_size); in vdo_configure_slab_depot()
671 last_block = partition->offset + total_slab_blocks; in vdo_configure_slab_depot()
675 .first_block = partition->offset, in vdo_configure_slab_depot()
683 (unsigned long long) (partition->count - (last_block - partition->offset))); in vdo_configure_slab_depot()
773 * allocate_partition() - Allocate a partition and add it to a layout.
774 * @layout: The layout containing the partition.
775 * @id: The id of the partition.
776 * @offset: The offset into the layout at which the partition begins.
777 * @size: The size of the partition in blocks.
784 struct partition *partition; in allocate_partition() local
787 result = vdo_allocate(1, struct partition, __func__, &partition); in allocate_partition()
791 partition->id = id; in allocate_partition()
792 partition->offset = offset; in allocate_partition()
793 partition->count = size; in allocate_partition()
794 partition->next = layout->head; in allocate_partition()
795 layout->head = partition; in allocate_partition()
801 * make_partition() - Create a new partition from the beginning or end of the unused space in a
804 * @id: The id of the partition to make.
806 * @beginning: True if the partition should start at the beginning of the unused space.
849 * @block_map_blocks: The size of the block map partition.
850 * @journal_blocks: The size of the journal partition.
851 * @summary_blocks: The size of the slab summary partition.
913 struct partition *part = layout->head; in vdo_uninitialize_layout()
923 * vdo_get_partition() - Get a partition by id.
924 * @layout: The layout from which to get a partition.
925 * @id: The id of the partition.
926 * @partition_ptr: A pointer to hold the partition.
931 struct partition **partition_ptr) in vdo_get_partition()
933 struct partition *partition; in vdo_get_partition() local
935 for (partition = layout->head; partition != NULL; partition = partition->next) { in vdo_get_partition()
936 if (partition->id == id) { in vdo_get_partition()
938 *partition_ptr = partition; in vdo_get_partition()
947 * vdo_get_known_partition() - Get a partition by id from a validated layout.
948 * @layout: The layout from which to get a partition.
949 * @id: The id of the partition.
951 * Return: the partition
953 struct partition *vdo_get_known_partition(struct layout *layout, enum partition_id id) in vdo_get_known_partition()
955 struct partition *partition; in vdo_get_known_partition() local
956 int result = vdo_get_partition(layout, id, &partition); in vdo_get_known_partition()
958 VDO_ASSERT_LOG_ONLY(result == VDO_SUCCESS, "layout has expected partition: %u", id); in vdo_get_known_partition()
960 return partition; in vdo_get_known_partition()
965 const struct partition *partition; in encode_layout() local
971 "layout partition count must fit in a byte"); in encode_layout()
983 for (partition = layout->head; partition != NULL; partition = partition->next) { in encode_layout()
984 buffer[(*offset)++] = partition->id; in encode_layout()
985 encode_u64_le(buffer, offset, partition->offset); in encode_layout()
988 encode_u64_le(buffer, offset, partition->count); in encode_layout()
1000 struct partition *partition; in decode_layout() local
1057 result = vdo_get_partition(layout, REQUIRED_PARTITIONS[i], &partition); in decode_layout()
1061 "layout is missing required partition %u", in decode_layout()
1065 start += partition->count; in decode_layout()