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()
786 * allocate_partition() - Allocate a partition and add it to a layout.
787 * @layout: The layout containing the partition.
788 * @id: The id of the partition.
789 * @offset: The offset into the layout at which the partition begins.
790 * @size: The size of the partition in blocks.
797 struct partition *partition; in allocate_partition() local
800 result = vdo_allocate(1, struct partition, __func__, &partition); in allocate_partition()
804 partition->id = id; in allocate_partition()
805 partition->offset = offset; in allocate_partition()
806 partition->count = size; in allocate_partition()
807 partition->next = layout->head; in allocate_partition()
808 layout->head = partition; in allocate_partition()
814 * make_partition() - Create a new partition from the beginning or end of the unused space in a
817 * @id: The id of the partition to make.
819 * @beginning: True if the partition should start at the beginning of the unused space.
862 * @block_map_blocks: The size of the block map partition.
863 * @journal_blocks: The size of the journal partition.
864 * @summary_blocks: The size of the slab summary partition.
926 struct partition *part = layout->head; in vdo_uninitialize_layout()
936 * vdo_get_partition() - Get a partition by id.
937 * @layout: The layout from which to get a partition.
938 * @id: The id of the partition.
939 * @partition_ptr: A pointer to hold the partition.
944 struct partition **partition_ptr) in vdo_get_partition()
946 struct partition *partition; in vdo_get_partition() local
948 for (partition = layout->head; partition != NULL; partition = partition->next) { in vdo_get_partition()
949 if (partition->id == id) { in vdo_get_partition()
951 *partition_ptr = partition; in vdo_get_partition()
960 * vdo_get_known_partition() - Get a partition by id from a validated layout.
961 * @layout: The layout from which to get a partition.
962 * @id: The id of the partition.
964 * Return: the partition
966 struct partition *vdo_get_known_partition(struct layout *layout, enum partition_id id) in vdo_get_known_partition()
968 struct partition *partition; in vdo_get_known_partition() local
969 int result = vdo_get_partition(layout, id, &partition); in vdo_get_known_partition()
971 VDO_ASSERT_LOG_ONLY(result == VDO_SUCCESS, "layout has expected partition: %u", id); in vdo_get_known_partition()
973 return partition; in vdo_get_known_partition()
978 const struct partition *partition; in encode_layout() local
984 "layout partition count must fit in a byte"); in encode_layout()
996 for (partition = layout->head; partition != NULL; partition = partition->next) { in encode_layout()
997 buffer[(*offset)++] = partition->id; in encode_layout()
998 encode_u64_le(buffer, offset, partition->offset); in encode_layout()
1001 encode_u64_le(buffer, offset, partition->count); in encode_layout()
1013 struct partition *partition; in decode_layout() local
1070 result = vdo_get_partition(layout, REQUIRED_PARTITIONS[i], &partition); in decode_layout()
1074 "layout is missing required partition %u", in decode_layout()
1078 start += partition->count; in decode_layout()