Lines Matching refs:metadata
102 const LpMetadataBlockDevice* GetMetadataSuperBlockDevice(const LpMetadata& metadata) { in GetMetadataSuperBlockDevice() argument
103 if (metadata.block_devices.empty()) { in GetMetadataSuperBlockDevice()
106 return &metadata.block_devices[0]; in GetMetadataSuperBlockDevice()
128 uint64_t GetTotalSuperPartitionSize(const LpMetadata& metadata) { in GetTotalSuperPartitionSize() argument
130 for (const auto& block_device : metadata.block_devices) { in GetTotalSuperPartitionSize()
136 std::vector<std::string> GetBlockDevicePartitionNames(const LpMetadata& metadata) { in GetBlockDevicePartitionNames() argument
138 for (const auto& block_device : metadata.block_devices) { in GetBlockDevicePartitionNames()
144 const LpMetadataPartition* FindPartition(const LpMetadata& metadata, const std::string& name) { in FindPartition() argument
145 for (const auto& partition : metadata.partitions) { in FindPartition()
153 uint64_t GetPartitionSize(const LpMetadata& metadata, const LpMetadataPartition& partition) { in GetPartitionSize() argument
156 const auto& extent = metadata.extents[partition.first_extent_index + i]; in GetPartitionSize()
224 bool UpdateMetadataForInPlaceSnapshot(LpMetadata* metadata, uint32_t source_slot_number, in UpdateMetadataForInPlaceSnapshot() argument
232 for (auto& group : metadata->groups) { in UpdateMetadataForInPlaceSnapshot()
250 for (auto& partition : metadata->partitions) { in UpdateMetadataForInPlaceSnapshot()
267 &metadata->groups[partition.group_index]); in UpdateMetadataForInPlaceSnapshot()
270 << GetPartitionGroupName(metadata->groups[partition.group_index]) in UpdateMetadataForInPlaceSnapshot()
281 metadata->partitions = std::move(new_partitions); in UpdateMetadataForInPlaceSnapshot()
285 metadata->groups = std::move(new_groups); in UpdateMetadataForInPlaceSnapshot()
294 void SetMetadataHeaderV0(LpMetadata* metadata) { in SetMetadataHeaderV0() argument
295 if (metadata->header.minor_version <= LP_METADATA_MINOR_VERSION_MIN) { in SetMetadataHeaderV0()
299 << metadata->header.minor_version << " to " << LP_METADATA_MAJOR_VERSION << "." in SetMetadataHeaderV0()
301 metadata->header.minor_version = LP_METADATA_MINOR_VERSION_MIN; in SetMetadataHeaderV0()
302 metadata->header.header_size = sizeof(LpMetadataHeaderV1_0); in SetMetadataHeaderV0()
306 if (metadata->header.flags) { in SetMetadataHeaderV0()
307 LWARN << "Zeroing unexpected flags: " << ToHexString(metadata->header.flags); in SetMetadataHeaderV0()
311 static_assert(sizeof(metadata->header) > sizeof(LpMetadataHeaderV1_0)); in SetMetadataHeaderV0()
312 memset(reinterpret_cast<uint8_t*>(&metadata->header) + sizeof(LpMetadataHeaderV1_0), 0, in SetMetadataHeaderV0()
313 sizeof(metadata->header) - sizeof(LpMetadataHeaderV1_0)); in SetMetadataHeaderV0()
317 for (auto& partition : metadata->partitions) { in SetMetadataHeaderV0()