Home
last modified time | relevance | path

Searched refs:geometry (Results 1 – 15 of 15) sorted by relevance

/system/core/fs_mgr/liblp/
Dreader.h31 bool ParseGeometry(const void* buffer, LpMetadataGeometry* geometry);
34 std::unique_ptr<LpMetadata> ParseMetadata(const LpMetadataGeometry& geometry, int fd);
35 std::unique_ptr<LpMetadata> ParseMetadata(const LpMetadataGeometry& geometry, const void* buffer,
37 bool ReadLogicalPartitionGeometry(int fd, LpMetadataGeometry* geometry);
38 bool ReadPrimaryGeometry(int fd, LpMetadataGeometry* geometry);
39 bool ReadBackupGeometry(int fd, LpMetadataGeometry* geometry);
44 std::unique_ptr<LpMetadata> ReadPrimaryMetadata(int fd, const LpMetadataGeometry& geometry,
46 std::unique_ptr<LpMetadata> ReadBackupMetadata(int fd, const LpMetadataGeometry& geometry,
Dreader.cpp75 bool ParseGeometry(const void* buffer, LpMetadataGeometry* geometry) { in ParseGeometry() argument
76 static_assert(sizeof(*geometry) <= LP_METADATA_GEOMETRY_SIZE); in ParseGeometry()
77 memcpy(geometry, buffer, sizeof(*geometry)); in ParseGeometry()
80 if (geometry->magic != LP_METADATA_GEOMETRY_MAGIC) { in ParseGeometry()
87 if (geometry->struct_size > sizeof(LpMetadataGeometry)) { in ParseGeometry()
93 LpMetadataGeometry temp = *geometry; in ParseGeometry()
96 if (memcmp(temp.checksum, geometry->checksum, sizeof(temp.checksum)) != 0) { in ParseGeometry()
103 if (geometry->struct_size != sizeof(LpMetadataGeometry)) { in ParseGeometry()
107 if (geometry->metadata_slot_count == 0) { in ParseGeometry()
111 if (geometry->metadata_max_size % LP_SECTOR_SIZE != 0) { in ParseGeometry()
[all …]
Dwriter.cpp35 LpMetadataGeometry geometry = input; in SerializeGeometry() local
36 memset(geometry.checksum, 0, sizeof(geometry.checksum)); in SerializeGeometry()
37 SHA256(&geometry, sizeof(geometry), geometry.checksum); in SerializeGeometry()
39 std::string blob(reinterpret_cast<const char*>(&geometry), sizeof(geometry)); in SerializeGeometry()
89 const LpMetadataGeometry& geometry = metadata.geometry; in ValidateAndSerializeMetadata() local
94 if (blob->size() > geometry.metadata_max_size) { in ValidateAndSerializeMetadata()
96 << geometry.metadata_max_size; in ValidateAndSerializeMetadata()
103 uint64_t(geometry.metadata_max_size) * geometry.metadata_slot_count; in ValidateAndSerializeMetadata()
190 int64_t primary_offset = GetPrimaryMetadataOffset(metadata.geometry, slot_number); in WritePrimaryMetadata()
208 int64_t backup_offset = GetBackupMetadataOffset(metadata.geometry, slot_number); in WriteBackupMetadata()
[all …]
Dutility_test.cpp44 LpMetadataGeometry geometry = {LP_METADATA_GEOMETRY_MAGIC, in TEST() local
45 sizeof(geometry), in TEST()
51 EXPECT_EQ(GetPrimaryMetadataOffset(geometry, 0), start + 8192); in TEST()
52 EXPECT_EQ(GetPrimaryMetadataOffset(geometry, 1), start + 8192 + 16384); in TEST()
53 EXPECT_EQ(GetPrimaryMetadataOffset(geometry, 2), start + 8192 + 16384 * 2); in TEST()
54 EXPECT_EQ(GetPrimaryMetadataOffset(geometry, 3), start + 8192 + 16384 * 3); in TEST()
57 EXPECT_EQ(GetBackupMetadataOffset(geometry, 3), backup_start + 16384 * 3); in TEST()
58 EXPECT_EQ(GetBackupMetadataOffset(geometry, 2), backup_start + 16384 * 2); in TEST()
59 EXPECT_EQ(GetBackupMetadataOffset(geometry, 1), backup_start + 16384 * 1); in TEST()
60 EXPECT_EQ(GetBackupMetadataOffset(geometry, 0), backup_start + 16384 * 0); in TEST()
Dimages.cpp49 LpMetadataGeometry geometry = {}; in IsEmptySuperImage() local
54 if (!android::base::ReadFully(fd, &geometry, sizeof(geometry))) { in IsEmptySuperImage()
58 return geometry.magic == LP_METADATA_GEOMETRY_MAGIC; in IsEmptySuperImage()
80 LpMetadataGeometry geometry; in ReadFromImageFile() local
81 if (!ParseGeometry(buffer.get(), &geometry)) { in ReadFromImageFile()
84 return ParseMetadata(geometry, fd); in ReadFromImageFile()
93 LpMetadataGeometry geometry; in ReadFromImageBlob() local
94 if (!ParseGeometry(data, &geometry)) { in ReadFromImageBlob()
101 return ParseMetadata(geometry, metadata_buffer, metadata_buffer_size); in ReadFromImageBlob()
114 std::string geometry = SerializeGeometry(input.geometry); in WriteToImageFile() local
[all …]
Dutility.cpp83 int64_t GetPrimaryMetadataOffset(const LpMetadataGeometry& geometry, uint32_t slot_number) { in GetPrimaryMetadataOffset() argument
84 CHECK(slot_number < geometry.metadata_slot_count); in GetPrimaryMetadataOffset()
86 geometry.metadata_max_size * slot_number; in GetPrimaryMetadataOffset()
90 int64_t GetBackupMetadataOffset(const LpMetadataGeometry& geometry, uint32_t slot_number) { in GetBackupMetadataOffset() argument
91 CHECK(slot_number < geometry.metadata_slot_count); in GetBackupMetadataOffset()
93 int64_t(geometry.metadata_max_size) * geometry.metadata_slot_count; in GetBackupMetadataOffset()
94 return start + int64_t(geometry.metadata_max_size * slot_number); in GetBackupMetadataOffset()
Dio_test.cpp182 EXPECT_EQ(exported->geometry.metadata_max_size, imported->geometry.metadata_max_size); in TEST_F()
183 EXPECT_EQ(exported->geometry.metadata_slot_count, imported->geometry.metadata_slot_count); in TEST_F()
283 imported->geometry.metadata_max_size += LP_SECTOR_SIZE; in TEST_F()
288 imported->geometry.metadata_slot_count++; in TEST_F()
308 LpMetadataGeometry geometry; in TEST_F() local
310 ASSERT_TRUE(android::base::ReadFully(fd, &geometry, sizeof(geometry))); in TEST_F()
312 LpMetadataGeometry bad_geometry = geometry; in TEST_F()
318 EXPECT_EQ(metadata->geometry.metadata_slot_count, 2); in TEST_F()
352 off_t offset = GetPrimaryMetadataOffset(metadata->geometry, 0); in TEST_F()
358 offset = GetBackupMetadataOffset(metadata->geometry, 0); in TEST_F()
[all …]
Dutility.h53 int64_t GetPrimaryMetadataOffset(const LpMetadataGeometry& geometry, uint32_t slot_number);
57 int64_t GetBackupMetadataOffset(const LpMetadataGeometry& geometry, uint32_t slot_number);
Dbuilder_test.cpp155 EXPECT_EQ(exported->geometry.metadata_max_size, 1024); in TEST_F()
249 static constexpr uint64_t geometry = 4 * 1024; in TEST_F() local
251 total - (metadata * slots + geometry) * 2 - LP_PARTITION_RESERVED_BYTES; in TEST_F()
340 const LpMetadataGeometry& geometry = exported->geometry; in TEST_F() local
341 EXPECT_EQ(geometry.magic, LP_METADATA_GEOMETRY_MAGIC); in TEST_F()
342 EXPECT_EQ(geometry.struct_size, sizeof(geometry)); in TEST_F()
343 EXPECT_EQ(geometry.metadata_max_size, 1024); in TEST_F()
344 EXPECT_EQ(geometry.metadata_slot_count, 2); in TEST_F()
Dbuilder.cpp317 geometry_ = metadata.geometry; in Init()
882 metadata->geometry = geometry_; in Export()
/system/core/fs_mgr/liblp/include/liblp/
Dliblp.h38 LpMetadataGeometry geometry; member
/system/extras/partition_tools/
Dlpdump.cc310 cout << "Metadata max size: " << pt.geometry.metadata_max_size << " bytes\n"; in PrintMetadata()
311 cout << "Metadata slot count: " << pt.geometry.metadata_slot_count << "\n"; in PrintMetadata()
512 uint32_t num_slots = pt->geometry.metadata_slot_count; in LpdumpMain()
Dlpunpack.cc240 SparseWriter writer(output_fd, image_fd_, metadata_->geometry.logical_block_size); in ExtractPartition()
Dlpadd.cc285 uint32_t slots = std::min(metadata_->geometry.metadata_slot_count, (uint32_t)2); in UpdateSuper()
/system/core/fastboot/
Dfastboot.cpp1822 auto block_size = metadata.geometry.logical_block_size; in wipe_super()