Searched refs:extents (Results 1 - 25 of 52) sorted by relevance

123

/system/update_engine/payload_generator/
H A Dextent_utils_unittest.cc35 vector<Extent> extents; local
37 EXPECT_EQ(0U, extents.size());
38 AppendBlockToExtents(&extents, kSparseHole);
39 EXPECT_EQ(1U, extents.size());
40 AppendBlockToExtents(&extents, 0);
41 EXPECT_EQ(2U, extents.size());
42 AppendBlockToExtents(&extents, kSparseHole);
43 AppendBlockToExtents(&extents, kSparseHole);
45 ASSERT_EQ(3U, extents.size());
46 EXPECT_EQ(kSparseHole, extents[
56 vector<Extent> extents; local
66 google::protobuf::RepeatedPtrField<Extent> extents; local
97 vector<Extent> extents; local
108 vector<Extent> extents = { local
124 vector<Extent> extents = { local
[all...]
H A Dgraph_utils_unittest.cc40 vector<Extent>& extents = graph[0].out_edges[1].extents; local
42 EXPECT_EQ(0U, extents.size());
43 AppendBlockToExtents(&extents, 0);
44 EXPECT_EQ(1U, extents.size());
45 AppendBlockToExtents(&extents, 1);
46 AppendBlockToExtents(&extents, 2);
47 EXPECT_EQ(1U, extents.size());
48 AppendBlockToExtents(&extents, 4);
50 EXPECT_EQ(2U, extents
[all...]
H A Dextent_utils.h32 // into an arbitrary place in the extents.
33 void AppendBlockToExtents(std::vector<Extent>* extents, uint64_t block);
38 std::vector<uint64_t> ExpandExtents(const T& extents) { argument
40 for (const auto& extent : extents) {
53 // Stores all Extents in 'extents' into 'out'.
54 void StoreExtents(const std::vector<Extent>& extents,
57 // Stores all extents in |extents| into |out_vector|.
58 void ExtentsToVector(const google::protobuf::RepeatedPtrField<Extent>& extents,
61 // Returns a string representing all extents i
[all...]
H A Dextent_utils.cc38 void AppendBlockToExtents(vector<Extent>* extents, uint64_t block) { argument
39 // First try to extend the last extent in |extents|, if any.
40 if (!extents->empty()) {
41 Extent& extent = extents->back();
53 extents->push_back(new_extent);
57 google::protobuf::RepeatedPtrField<Extent>* extents,
61 ExtentsToVector(*extents, &extents_vector);
67 extents->Clear();
68 StoreExtents(extents_vector, extents);
71 // Stores all Extents in 'extents' int
56 ExtendExtents( google::protobuf::RepeatedPtrField<Extent>* extents, const google::protobuf::RepeatedPtrField<Extent>& extents_to_add) argument
72 StoreExtents(const vector<Extent>& extents, google::protobuf::RepeatedPtrField<Extent>* out) argument
81 ExtentsToVector(const google::protobuf::RepeatedPtrField<Extent>& extents, vector<Extent>* out_vector) argument
89 ExtentsToString(const vector<Extent>& extents) argument
98 NormalizeExtents(vector<Extent>* extents) argument
118 ExtentsSublist(const vector<Extent>& extents, uint64_t block_offset, uint64_t block_count) argument
[all...]
H A Dfake_filesystem.cc42 const std::vector<Extent>& extents) {
45 file.extents = extents;
46 for (const Extent& extent : extents) {
41 AddFile(const std::string& filename, const std::vector<Extent>& extents) argument
H A Ddeflate_utils_unittest.cc125 vector<Extent> extents = { local
140 out_deflates = FindDeflates(extents, in_deflates);
145 vector<Extent> extents = {}; local
149 out_deflates = FindDeflates(extents, in_deflates);
152 extents = {};
154 out_deflates = FindDeflates(extents, in_deflates);
159 vector<Extent> extents = { local
166 ASSERT_TRUE(CompactDeflates(extents, in_deflates, &out_deflates));
171 vector<Extent> extents = {}; local
175 EXPECT_FALSE(CompactDeflates(extents, in_deflate
[all...]
H A Dext2_filesystem_unittest.cc52 // Checks that all the blocks in |extents| are in the range [0, total_blocks).
53 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { argument
54 for (const Extent& extent : extents) {
91 ExpectBlocksInRange(file.extents, fs->GetBlockCount());
94 EXPECT_FALSE(map_files["<free-space>"].extents.empty());
122 ExpectBlocksInRange(file.extents, fs->GetBlockCount());
160 EXPECT_TRUE(map_files["/link-short_symlink"].extents.empty());
162 utils::BlocksInExtents(map_files["/link-long_symlink"].extents));
165 EXPECT_EQ(map_files["/link-hard-regular-16k"].extents,
166 map_files["/regular-16k"].extents);
[all...]
H A Ddeflate_utils.cc46 // TODO(*): Optimize this so we don't have to read all extents into memory in
49 const vector<Extent> extents,
52 brillo::Blob data(utils::BlocksInExtents(extents) * block_size);
54 utils::ReadExtents(in_path, extents, &data, data.size(), block_size));
64 utils::BlocksInExtents(file.extents) >=
69 file.extents[0].start_block() * kBlockSize,
86 ShiftExtentsOverExtents(file.extents, &in_file.extents));
88 ShiftBitExtentsOverExtents(file.extents, &in_file.deflates));
91 num_blocks += utils::BlocksInExtents(in_file.extents);
48 CopyExtentsToFile(const string& in_path, const vector<Extent> extents, const string& out_path, size_t block_size) argument
197 FindDeflates(const vector<Extent>& extents, const vector<BitExtent>& in_deflates) argument
212 CompactDeflates(const vector<Extent>& extents, const vector<BitExtent>& in_deflates, vector<BitExtent>* out_deflates) argument
242 FindAndCompactDeflates(const vector<Extent>& extents, const vector<BitExtent>& in_deflates, vector<BitExtent>* out_deflates) argument
[all...]
H A Dgraph_utils.cc40 const vector<Extent>& extents = local
41 graph[edge.first].out_edges.find(edge.second)->second.extents;
42 for (vector<Extent>::const_iterator it = extents.begin();
43 it != extents.end(); ++it) {
61 AppendBlockToExtents(&edge_it->second.extents, block);
66 const vector<Extent>& extents) {
68 for (vector<Extent>::const_iterator it = extents.begin(), e = extents.end();
85 if (it->second.extents.empty()) {
117 DumpExtents(it->second.extents,
64 AddReadBeforeDepExtents(Vertex* src, Vertex::Index dst, const vector<Extent>& extents) argument
[all...]
H A Dsquashfs_filesystem_unittest.cc53 // Checks that all the blocks in |extents| are in the range [0, total_blocks).
54 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { argument
55 for (const Extent& extent : extents) {
87 ExpectBlocksInRange(file.extents, fs->GetBlockCount());
95 return a.extents[0].start_block() <
96 b.extents[0].start_block();
102 return a.extents[0].start_block() + a.extents[0].num_blocks() >
103 b.extents[0].start_block();
127 file.extents
[all...]
H A Dmapfile_filesystem_unittest.cc46 // Checks that all the blocks in |extents| are in the range [0, total_blocks).
47 void ExpectBlocksInRange(const vector<Extent>& extents, uint64_t total_blocks) { argument
48 for (const Extent& extent : extents) {
94 ExpectBlocksInRange(file.extents, fs->GetBlockCount());
97 EXPECT_EQ(map_files["/fileA"].extents,
99 EXPECT_EQ(map_files["/fileB"].extents,
102 map_files["/fileC"].extents,
105 EXPECT_EQ(map_files["/file with spaces"].extents,
107 EXPECT_EQ(map_files["/1234"].extents, (vector<Extent>{ExtentForRange(7, 1)}));
H A Ddeflate_utils.h36 // Spreads all extents in |over_extents| over |base_extents|. Here we assume the
49 // Spreads all extents in |over_extents| over |base_extents|. Here we assume the
51 // |over_extents| is removed if it is spread in two or more extents in
65 // |extents|. This function should not change the order of deflates.
67 const std::vector<Extent>& extents,
71 // by assuming all extents in the |extents| have been put together
73 // |in_deflates| are located somewhere in the |extents|. |out_deflates| should
76 // |extents|:
83 bool CompactDeflates(const std::vector<Extent>& extents,
[all...]
H A Dextent_ranges.h28 // An ExtentRanges object represents an unordered collection of extents (and
31 // ignores sparse hole extents mostly to avoid confusion between extending a
54 void AddExtents(const std::vector<Extent>& extents);
55 void SubtractExtents(const std::vector<Extent>& extents);
75 // Returns an ordered vector of extents for |count| blocks,
76 // using extents in extent_set_. The returned extents are not
86 // Filters out from the passed list of extents |extents| all the blocks in the
87 // ExtentRanges set. Note that the order of the blocks in |extents| i
[all...]
H A Dgraph_types.h38 // Read-before extents. I.e., blocks in |extents| must be read by the
41 std::vector<Extent> extents; member in struct:chromeos_update_engine::EdgeProperties
43 // Write before extents. I.e., blocks in |write_extents| must be written
49 return extents == that.extents && write_extents == that.write_extents;
H A Dsquashfs_filesystem.cc150 file.extents = {ExtentForBytes(kBlockSize, start, cur_offset - start)};
157 return a.extents[0].start_block() < b.extents[0].start_block();
159 // If there is any overlap between two consecutive extents, remove them. Here
165 auto first_begin = first->extents[0].start_block();
166 auto first_end = first_begin + first->extents[0].num_blocks();
167 auto second_begin = second->extents[0].start_block();
168 auto second_end = second_begin + second->extents[0].num_blocks();
180 // Remove overlapping extents from the first file.
181 first->extents[
[all...]
H A Dext2_filesystem.cc58 vector<Extent>* extents = static_cast<vector<Extent>*>(priv); local
59 AppendBlockToExtents(extents, *blocknr);
230 &file.extents);
289 AppendBlockToExtents(&inode_file.extents, block);
304 AppendBlockToExtents(&free_space.extents, block);
314 if (ino_file.second.extents.empty())
319 ranges.AddExtents(file.extents);
320 file.extents = ranges.GetExtentsForBlockCount(ranges.blocks());
342 vector<Extent> extents;
346 &extents);
[all...]
H A Dgraph_utils.h33 // Returns the number of blocks represented by all extents in the edge.
43 const std::vector<Extent>& extents);
H A Draw_filesystem.cc48 file.extents = { ExtentForRange(0, block_count_) };
/system/update_engine/payload_consumer/
H A Dextent_reader_unittest.cc64 void ReadExtents(vector<Extent> extents, brillo::Blob* blob) { argument
66 for (const auto& extent : extents) {
80 vector<Extent> extents = {ExtentForRange(1, 1)}; local
82 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
84 brillo::Blob blob1(utils::BlocksInExtents(extents) * kBlockSize);
87 ReadExtents(extents, &blob2);
92 vector<Extent> extents = {ExtentForRange(1, 0)}; local
94 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents
111 vector<Extent> extents = {ExtentForRange(1, 1)}; local
120 vector<Extent> extents = {ExtentForRange(1, 0)}; local
135 vector<Extent> extents = {ExtentForRange(1, 1)}; local
144 vector<Extent> extents = {ExtentForRange(0, 0), local
[all...]
H A Dfile_descriptor_utils_unittest.cc82 // Source and target extents should have the same number of blocks.
93 auto extents = CreateExtentList({{0, 5}}); local
97 source_, extents, target_, extents, 4, nullptr));
112 // Test that we can copy extents without hashing them, allowing a nullptr
115 auto extents = CreateExtentList({{0, 5}}); local
118 source_, extents, target_, extents, 4, nullptr));
122 // CopyAndHash() can take different number of extents in the source and target
172 auto extents local
180 auto extents = CreateExtentList({{0, 5}}); local
187 auto extents = CreateExtentList({{1, 1}, {4, 1}, {2, 2}, {0, 1}}); local
[all...]
H A Dextent_writer_unittest.cc69 vector<Extent> extents = {ExtentForRange(1, 1)}; local
73 direct_writer.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
90 vector<Extent> extents = {ExtentForRange(1, 1)}; local
93 direct_writer.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
112 vector<Extent> extents = { local
119 direct_writer.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
158 vector<Extent> extents local
194 vector<Extent> extents = {ExtentForRange(1, 1), local
[all...]
H A Dextent_writer.h31 // file descriptor at the extents given.
44 const google::protobuf::RepeatedPtrField<Extent>& extents,
62 // It writes the data directly into the extents.
70 const google::protobuf::RepeatedPtrField<Extent>& extents,
74 extents_ = extents;
105 const google::protobuf::RepeatedPtrField<Extent>& extents,
108 return underlying_extent_writer_->Init(fd, extents, block_size);
H A Dbzip_extent_writer_unittest.cc60 vector<Extent> extents = {ExtentForRange(0, 1)}; local
73 bzip_writer.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
103 vector<Extent> extents = { local
108 bzip_writer.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
H A Dfile_descriptor_utils.h46 // specified by |extents|. Stores the hash in |hash_out| if it is not null. The
51 const google::protobuf::RepeatedPtrField<Extent>& extents,
H A Dextent_reader.h28 // the extents given.
35 const google::protobuf::RepeatedPtrField<Extent>& extents,
38 // Seeks to the given |offset| assuming all extents are concatenated together.
46 // It reads the data directly from the extents.
53 const google::protobuf::RepeatedPtrField<Extent>& extents,
69 // Offset assuming all extents are concatenated.
72 // The accelaring upper bounds for |extents_| if we assume all extents are

Completed in 675 milliseconds

123