Home
last modified time | relevance | path

Searched refs:block_size (Results 1 – 25 of 117) sorted by relevance

12345

/system/update_engine/payload_consumer/
Dfile_descriptor_utils.cc41 uint64_t block_size, in CommonHashExtents() argument
44 auto buffer_blocks = kMaxCopyBufferSize / block_size; in CommonHashExtents()
48 brillo::Blob buf(buffer_blocks * block_size); in CommonHashExtents()
51 TEST_AND_RETURN_FALSE(reader.Init(source, src_extents, block_size)); in CommonHashExtents()
56 TEST_AND_RETURN_FALSE(reader.Read(buf.data(), read_blocks * block_size)); in CommonHashExtents()
59 source_hasher.Update(buf.data(), read_blocks * block_size)); in CommonHashExtents()
63 writer->Write(buf.data(), read_blocks * block_size)); in CommonHashExtents()
83 uint64_t block_size, in CopyAndHashExtents() argument
86 TEST_AND_RETURN_FALSE(writer.Init(target, tgt_extents, block_size)); in CopyAndHashExtents()
90 CommonHashExtents(source, src_extents, &writer, block_size, hash_out)); in CopyAndHashExtents()
[all …]
Dverity_writer_android.cc56 partition_->block_size, hash_function); in Init()
112 partition_->block_size, in Update()
125 uint32_t block_size, in EncodeFEC() argument
127 TEST_AND_RETURN_FALSE(data_size % block_size == 0); in EncodeFEC()
131 uint64_t rounds = utils::DivRoundUp(data_size / block_size, rs_n); in EncodeFEC()
132 TEST_AND_RETURN_FALSE(rounds * fec_roots * block_size == fec_size); in EncodeFEC()
149 brillo::Blob rs_blocks(block_size * rs_n); in EncodeFEC()
151 brillo::Blob buffer(block_size, 0); in EncodeFEC()
153 fec_ecc_interleave(i * rs_n * block_size + j, rs_n, rounds); in EncodeFEC()
169 brillo::Blob fec(block_size * fec_roots); in EncodeFEC()
[all …]
Dextent_writer.h43 uint32_t block_size) = 0;
59 uint32_t block_size) override { in Init() argument
61 block_size_ = block_size; in Init()
Dfile_descriptor_utils.h42 uint64_t block_size,
52 uint64_t block_size,
/system/update_engine/scripts/update_payload/
Dchecker_unittest.py534 block_size = payload_checker.block_size
538 int(3.5 * block_size), 4, 'foo', 'bar'))
541 int(3.5 * block_size), 3, 'foo', 'bar')
544 int(3.5 * block_size), 5, 'foo', 'bar')
549 block_size = payload_checker.block_size
555 payload_checker._CheckExtents(extents, (1024 + 16) * block_size,
562 (1024 + 16) * block_size, collections.defaultdict(int), 'foo')
568 (1024 + 16) * block_size, collections.defaultdict(int), 'foo')
574 (1024 + 16) * block_size, collections.defaultdict(int), 'foo')
580 (1024 + 15) * block_size, collections.defaultdict(int), 'foo')
[all …]
Dapplier.py95 def _ReadExtents(file_obj, extents, block_size, max_length=-1): argument
115 read_length = min(max_length, ex.num_blocks * block_size)
117 file_obj.seek(ex.start_block * block_size)
125 def _WriteExtents(file_obj, data, extents, block_size, base_name): argument
145 write_length = min(data_length, ex.num_blocks * block_size)
146 file_obj.seek(ex.start_block * block_size)
156 def _ExtentsToBspatchArg(extents, block_size, base_name, data_length=-1): argument
182 start_byte = ex.start_block * block_size
183 num_bytes = ex.num_blocks * block_size
224 self.block_size = payload.manifest.block_size
[all …]
Dchecker.py297 def __init__(self, payload, assert_type=None, block_size=0, argument
313 self.block_size = block_size if block_size else _DEFAULT_BLOCK_SIZE
314 if not _IsPowerOfTwo(self.block_size):
316 'Expected block (%d) size is not a power of two.' % self.block_size)
541 def _CheckBlocksFitLength(length, num_blocks, block_size, length_name, argument
559 if length > num_blocks * block_size:
562 (length_name, length, block_name or '', num_blocks, block_size))
565 if length <= (num_blocks - 1) * block_size:
568 (length_name, length, block_name or '', num_blocks - 1, block_size))
615 if actual_block_size != self.block_size:
[all …]
/system/update_engine/payload_generator/
Dpayload_generation_config_android.cc79 const size_t block_size = part.fs_interface->GetBlockSize(); in VerifyVerityConfig() local
84 HashTreeBuilder hash_tree_builder(block_size, hash_function); in VerifyVerityConfig()
86 part.verity.hash_tree_data_extent.num_blocks() * block_size; in VerifyVerityConfig()
89 tree_size == part.verity.hash_tree_extent.num_blocks() * block_size); in VerifyVerityConfig()
95 block_size, in VerifyVerityConfig()
110 part.verity.hash_tree_extent.start_block() * block_size, in VerifyVerityConfig()
119 part.verity.fec_data_extent.start_block() * block_size, in VerifyVerityConfig()
120 part.verity.fec_data_extent.num_blocks() * block_size, in VerifyVerityConfig()
121 part.verity.fec_extent.start_block() * block_size, in VerifyVerityConfig()
122 part.verity.fec_extent.num_blocks() * block_size, in VerifyVerityConfig()
[all …]
Dblock_mapping.cc120 const size_t block_size = other_block.size(); in CompareData() local
121 brillo::Blob blob(block_size); in CompareData()
123 if (!utils::PReadAll(fd, blob.data(), block_size, byte_offset, &bytes_read)) in CompareData()
125 if (static_cast<size_t>(bytes_read) != block_size) in CompareData()
144 size_t block_size, in MapPartitionBlocks() argument
147 BlockMapping mapping(block_size); in MapPartitionBlocks()
148 if (mapping.AddBlock(brillo::Blob(block_size, '\0')) != 0) in MapPartitionBlocks()
156 old_fd, 0, old_size / block_size, old_block_ids)); in MapPartitionBlocks()
158 new_fd, 0, new_size / block_size, new_block_ids)); in MapPartitionBlocks()
Dfull_update_generator_unittest.cc41 config_.block_size = 4096; in SetUp()
87 static_cast<uint64_t>(i * config_.hard_chunk_size / config_.block_size), in TEST_F()
90 EXPECT_EQ(config_.hard_chunk_size / config_.block_size, in TEST_F()
115 EXPECT_EQ(config_.hard_chunk_size / config_.block_size, in TEST_F()
117 EXPECT_EQ((new_part.size() - config_.hard_chunk_size) / config_.block_size, in TEST_F()
137 EXPECT_EQ(new_part.size() / config_.block_size, in TEST_F()
Dfull_update_generator.cc136 TEST_AND_RETURN_FALSE(full_chunk_size % config.block_size == 0); in GenerateOperations()
138 size_t chunk_blocks = full_chunk_size / config.block_size; in GenerateOperations()
142 << " blocks (" << config.block_size << " bytes each) using " in GenerateOperations()
151 size_t partition_blocks = new_part.size / config.block_size; in GenerateOperations()
176 static_cast<off_t>(start_block) * config.block_size, in GenerateOperations()
177 num_blocks * config.block_size, in GenerateOperations()
Dblock_mapping.h40 explicit BlockMapping(size_t block_size) : block_size_(block_size) {} in BlockMapping() argument
108 size_t block_size,
/system/core/libsparse/
Dsparse.cpp30 struct sparse_file* sparse_file_new(unsigned int block_size, int64_t len) { in sparse_file_new() argument
36 s->backed_block_list = backed_block_list_new(block_size); in sparse_file_new()
42 s->block_size = block_size; in sparse_file_new()
82 last_block = backed_block_block(bb) + DIV_ROUND_UP(backed_block_len(bb), s->block_size); in sparse_count_chunks()
84 if (last_block < DIV_ROUND_UP(s->len, s->block_size)) { in sparse_count_chunks()
123 write_skip_chunk(out, (int64_t)blocks * s->block_size); in write_all_blocks()
127 last_block = backed_block_block(bb) + DIV_ROUND_UP(backed_block_len(bb), s->block_size); in write_all_blocks()
130 pad = s->len - (int64_t)last_block * s->block_size; in write_all_blocks()
157 out = output_file_open_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc); in sparse_file_write()
175 out = output_file_open_callback(write, priv, s->block_size, s->len, false, sparse, chunks, crc); in sparse_file_callback()
[all …]
Dimg2simg.cpp49 unsigned int block_size = 4096; in main() local
58 block_size = atoi(argv[3]); in main()
61 if (block_size < 1024 || block_size % 4 != 0) { in main()
89 s = sparse_file_new(block_size, len); in main()
Doutput_file.cpp81 unsigned int block_size; member
323 if (skip_len % out->block_size) { in write_sparse_skip_chunk()
325 out->block_size); in write_sparse_skip_chunk()
332 chunk_header.chunk_sz = skip_len / out->block_size; in write_sparse_skip_chunk()
349 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_fill_chunk()
354 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_fill_chunk()
363 count = out->block_size / sizeof(uint32_t); in write_sparse_fill_chunk()
379 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_data_chunk()
385 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_data_chunk()
442 unsigned int rnd_up_len = ALIGN(len, out->block_size); in write_normal_data_chunk()
[all …]
/system/apex/apexd/
Dapexd_verity.cpp68 auto block_size = verity_data.desc->hash_block_size; in GenerateHashTree() local
77 auto builder = std::make_unique<HashTreeBuilder>(block_size, hash_fn); in GenerateHashTree()
86 auto block_count = image_size / block_size; in GenerateHashTree()
87 auto buf = std::vector<uint8_t>(block_size); in GenerateHashTree()
89 if (!ReadFully(fd, buf.data(), block_size)) { in GenerateHashTree()
92 if (!builder->Update(buf.data(), block_size)) { in GenerateHashTree()
124 auto block_size = verity_data.desc->hash_block_size; in CalculateRootDigest() local
126 std::vector<uint8_t> root_verity(block_size); in CalculateRootDigest()
127 if (!ReadFully(fd.get(), root_verity.data(), block_size)) { in CalculateRootDigest()
128 return ErrnoError() << "Failed to read " << block_size << " bytes from " in CalculateRootDigest()
[all …]
/system/extras/ext4_utils/
Dext4_utils.cpp112 aux_info.first_data_block = (info.block_size > 1024) ? 0 : 1; in ext4_create_fs_aux_info()
113 aux_info.len_blocks = info.len / info.block_size; in ext4_create_fs_aux_info()
115 info.block_size); in ext4_create_fs_aux_info()
118 aux_info.blocks_per_ind = info.block_size / sizeof(u32); in ext4_create_fs_aux_info()
124 info.block_size); in ext4_create_fs_aux_info()
145 aux_info.sb_zero = (struct ext4_super_block *)calloc(1, info.block_size); in ext4_create_fs_aux_info()
154 aux_info.sb_block = (struct ext4_super_block *)calloc(1, info.block_size); in ext4_create_fs_aux_info()
158 if (info.block_size > 1024) in ext4_create_fs_aux_info()
169 aux_info.bg_desc = (struct ext2_group_desc *)calloc(info.block_size, aux_info.bg_desc_blocks); in ext4_create_fs_aux_info()
282 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET); in read_ext()
[all …]
/system/extras/verity/
Dbuild_verity_tree_utils.cpp23 size_t verity_tree_blocks(uint64_t data_size, size_t block_size, in verity_tree_blocks() argument
25 uint64_t level_blocks = div_round_up(data_size, block_size); in verity_tree_blocks()
26 uint64_t hashes_per_block = div_round_up(block_size, hash_size); in verity_tree_blocks()
Dbuild_verity_tree.cpp29 size_t block_size, bool sparse, bool verbose) { in generate_verity_tree() argument
49 if (len % block_size != 0) { in generate_verity_tree()
50 LOG(ERROR) << "file size " << len << " is not a multiple of " << block_size in generate_verity_tree()
/system/core/fs_mgr/liblp/
Dimages.cpp135 ImageBuilder::ImageBuilder(const LpMetadata& metadata, uint32_t block_size, in ImageBuilder() argument
139 block_size_(block_size), in ImageBuilder()
143 if (block_size % LP_SECTOR_SIZE != 0) { in ImageBuilder()
147 if (total_size % block_size != 0) { in ImageBuilder()
148 LERROR << "Device size must be a multiple of the block size, " << block_size; in ImageBuilder()
151 if (metadata.geometry.metadata_max_size % block_size != 0) { in ImageBuilder()
152 LERROR << "Metadata max size must be a multiple of the block size, " << block_size; in ImageBuilder()
155 if (LP_METADATA_GEOMETRY_SIZE % block_size != 0) { in ImageBuilder()
156 LERROR << "Geometry size is not a multiple of the block size, " << block_size; in ImageBuilder()
159 if (LP_PARTITION_RESERVED_BYTES % block_size != 0) { in ImageBuilder()
[all …]
/system/nfc/src/nfc/tags/
Drw_i93.cc223 p_i93->block_size = I93_TAG_IT_HF_I_STD_PRO_CHIP_INLAY_BLK_SIZE; in rw_i93_get_product_version()
286 STREAM_TO_UINT8(p_i93->block_size, p); in rw_i93_process_ext_sys_info()
289 p_i93->block_size = (p_i93->block_size & 0x1F) + 1; in rw_i93_process_ext_sys_info()
373 STREAM_TO_UINT8(p_i93->block_size, p); in rw_i93_process_sys_info()
376 p_i93->block_size = (p_i93->block_size & 0x1F) + 1; in rw_i93_process_sys_info()
395 p_i93->block_size = 4; in rw_i93_process_sys_info()
429 p_i93->block_size = 4; in rw_i93_process_sys_info()
450 p_i93->block_size = 4; in rw_i93_process_sys_info()
631 rw_data.i93_sys_info.block_size = p_i93->block_size; in rw_i93_send_to_upper()
652 rw_data.i93_sys_info.block_size = p_i93->block_size; in rw_i93_send_to_upper()
[all …]
/system/vold/
DEncryptInplace.cpp129 LOG(INFO) << "Encrypted to sector " << offset / info.block_size * CRYPT_SECTOR_SIZE; in log_progress()
135 … LOG(INFO) << "Encrypting from sector " << data->offset / info.block_size * CRYPT_SECTOR_SIZE; in log_progress()
140 offset = data->offset + (off64_t)data->count * info.block_size; in log_progress()
151 if (pread64(data->realfd, data->buffer, info.block_size * data->count, data->offset) <= 0) { in flush_outstanding_data()
156 if (pwrite64(data->cryptofd, data->buffer, info.block_size * data->count, data->offset) <= 0) { in flush_outstanding_data()
166 (data->offset + data->count) / info.block_size * CRYPT_SECTOR_SIZE - 1; in flush_outstanding_data()
177 data->buffer = (char*)malloc(info.block_size * BLOCKS_AT_A_TIME); in encrypt_groups()
183 block_bitmap = (u8*)malloc(info.block_size); in encrypt_groups()
195 off64_t offset = (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap; in encrypt_groups()
197 ret = pread64(data->realfd, block_bitmap, info.block_size, offset); in encrypt_groups()
[all …]
DCheckpoint.cpp418 uint32_t block_size; member
565 write(device_fd, &ls_buffer[0], ls.block_size); in restoreSector()
591 sector_t sector, uint32_t size, uint32_t block_size) { in relocatedRead() argument
600 for (uint32_t i = 0; i < size; i += block_size, sector += block_size / kSectorSize) { in relocatedRead()
604 read(device_fd, &buffer[i], block_size); in relocatedRead()
639 original_ls.block_size, original_ls.block_size); in cp_restoreCheckpoint()
650 if (ls.block_size != original_ls.block_size) { in cp_restoreCheckpoint()
671 ls.block_size); in cp_restoreCheckpoint()
672 uint32_t checksum = le->source / (ls.block_size / kSectorSize); in cp_restoreCheckpoint()
673 for (size_t i = 0; i < le->size; i += ls.block_size) { in cp_restoreCheckpoint()
[all …]
/system/update_engine/sample_images/
Dgenerate_images.sh44 local block_size="$2"
61 sudo truncate --size=$(( block_size * 2 )) "${mntdir}"/sparse_empty-2blocks
73 seek=$(( block_size * 10000 )) status=none
212 local block_size="${5:-4096}"
215 local mkfs_opts=( -q -F -b "${block_size}" -L "ROOT-TEST" -t ext2 )
235 add_files_ue_settings "${mntdir}" "${block_size}"
236 add_files_postinstall "${mntdir}" "${block_size}"
239 add_files_default "${mntdir}" "${block_size}"
/system/core/fastboot/
Dfs.cpp117 static constexpr int block_size = 4096; in generate_ext4_image() local
123 std::string block_size_str = std::to_string(block_size); in generate_ext4_image()
128 int raid_stride = logicalBlkSize / block_size; in generate_ext4_image()
129 int raid_stripe_width = eraseBlkSize / block_size; in generate_ext4_image()
131 if (logicalBlkSize != 0 && logicalBlkSize < 8192) raid_stride = 8192 / block_size; in generate_ext4_image()
142 std::string size_str = std::to_string(partSize / block_size); in generate_ext4_image()

12345