/system/extras/verity/ |
D | build_verity_tree.cpp | 22 uint64_t block_size; member 36 size_t verity_tree_blocks(uint64_t data_size, size_t block_size, size_t hash_size, in verity_tree_blocks() argument 39 size_t level_blocks = div_round_up(data_size, block_size); in verity_tree_blocks() 40 int hashes_per_block = div_round_up(block_size, hash_size); in verity_tree_blocks() 76 size_t block_size) in hash_blocks() argument 80 for (size_t i = 0; i < in_size; i += block_size) { in hash_blocks() 81 hash_block(md, in + i, block_size, salt, salt_size, out, &s); in hash_blocks() 92 assert(len % ctx->block_size == 0); in hash_chunk() 97 ctx->salt, ctx->salt_size, ctx->block_size); in hash_chunk() 100 for (size_t i = 0; i < (size_t)len; i += ctx->block_size) { in hash_chunk() [all …]
|
/system/extras/ext4_utils/ |
D | ext2simg.c | 64 block_bitmap = malloc(info.block_size); in build_sparse_ext() 70 info.block_size * aux_info.first_data_block, 0); in build_sparse_ext() 76 ret = lseek64(fd, (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap, in build_sparse_ext() 81 ret = read(fd, block_bitmap, info.block_size); in build_sparse_ext() 84 if (ret != (int)info.block_size) in build_sparse_ext() 95 (u64)info.block_size * start_block, in build_sparse_ext() 96 info.block_size * len_blocks, start_block); in build_sparse_ext() 109 (u64)info.block_size * start_block, in build_sparse_ext() 110 info.block_size * len_blocks, start_block); in build_sparse_ext() 173 ext4_sparse_file = sparse_file_new(info.block_size, info.len); in main()
|
D | indirect.c | 31 if (DIV_ROUND_UP(backing_len, info.block_size) > EXT4_NDIR_BLOCKS) in create_backing() 45 len = min(region_len * info.block_size, backing_len); in create_backing() 123 u32 *ind_block_data = calloc(info.block_size, 1); in fill_dindirect_block() 124 sparse_file_add_data(ext4_sparse_file, ind_block_data, info.block_size, in fill_dindirect_block() 153 u32 *dind_block_data = calloc(info.block_size, 1); in fill_tindirect_block() 154 sparse_file_add_data(ext4_sparse_file, dind_block_data, info.block_size, in fill_tindirect_block() 202 u32 *ind_block_data = calloc(info.block_size, 1); in inode_attach_indirect_blocks() 203 sparse_file_add_data(ext4_sparse_file, ind_block_data, info.block_size, in inode_attach_indirect_blocks() 234 u32 *dind_block_data = calloc(info.block_size, 1); in inode_attach_dindirect_blocks() 235 sparse_file_add_data(ext4_sparse_file, dind_block_data, info.block_size, in inode_attach_dindirect_blocks() [all …]
|
D | ext4_utils.c | 139 aux_info.first_data_block = (info.block_size > 1024) ? 0 : 1; in ext4_create_fs_aux_info() 140 aux_info.len_blocks = info.len / info.block_size; in ext4_create_fs_aux_info() 142 info.block_size); in ext4_create_fs_aux_info() 145 aux_info.blocks_per_ind = info.block_size / sizeof(u32); in ext4_create_fs_aux_info() 151 info.block_size); in ext4_create_fs_aux_info() 165 aux_info.sb = calloc(info.block_size, 1); in ext4_create_fs_aux_info() 172 aux_info.bg_desc = calloc(info.block_size, aux_info.bg_desc_blocks); in ext4_create_fs_aux_info() 202 sb->s_log_block_size = log_2(info.block_size / 1024); in ext4_fill_in_sb() 203 sb->s_obso_log_frag_size = log_2(info.block_size / 1024); in ext4_fill_in_sb() 273 aux_info.backup_sb[i] = calloc(info.block_size, 1); in ext4_fill_in_sb() [all …]
|
D | ext4fixup.c | 175 inode_offset = ((unsigned long long)aux_info.bg_desc[bg_num].bg_inode_table * info.block_size) + in read_inode() 195 off = block_num * info.block_size; in read_block() 201 len=read(fd, block, info.block_size); in read_block() 202 if (len != info.block_size) { in read_block() 218 off = block_num * info.block_size; in write_block() 224 len=write(fd, block, info.block_size); in write_block() 225 if (len != info.block_size) { in write_block() 294 if (new_inodes_per_group % (info.block_size/info.inode_size)) { in update_superblocks_and_bg_desc() 325 * info.blocks_per_group * info.block_size in update_superblocks_and_bg_desc() 330 ret = lseek64(fd, ((unsigned long long)i * info.blocks_per_group * info.block_size) + in update_superblocks_and_bg_desc() [all …]
|
D | extent.c | 43 len = min(region_len * info.block_size, backing_len); in extent_create_backing() 65 len = min(region_len * info.block_size, backing_len); in extent_create_backing_file() 77 u32 block_len = DIV_ROUND_UP(len, info.block_size); in do_inode_allocate_extents() 123 u8 *data = calloc(info.block_size, 1); in do_inode_allocate_extents() 127 sparse_file_add_data(ext4_sparse_file, data, info.block_size, in do_inode_allocate_extents() 130 if (((int)(info.block_size - sizeof(struct ext4_extent_header) / in do_inode_allocate_extents() 140 hdr->eh_max = (info.block_size - sizeof(struct ext4_extent_header)) / in do_inode_allocate_extents() 164 blocks = (u64)block_len * info.block_size / 512; in do_inode_allocate_extents()
|
D | contents.c | 55 if (len % info.block_size + dentry_len > info.block_size) in dentry_size() 56 len += info.block_size - (len % info.block_size); in dentry_size() 71 u32 start_block = *offset / info.block_size; in add_dentry() 72 u32 end_block = (*offset + rec_len - 1) / info.block_size; in add_dentry() 78 prev->rec_len += end_block * info.block_size - *offset; in add_dentry() 79 *offset = end_block * info.block_size; in add_dentry() 111 blocks = DIV_ROUND_UP(dentry_size(entries, dentries), info.block_size); in make_directory() 112 len = blocks * info.block_size; in make_directory() 239 u8 *data = inode_allocate_data_indirect(inode, info.block_size, info.block_size); in make_link() 241 inode->i_blocks_lo = info.block_size / 512; in make_link() [all …]
|
D | make_ext4fs.c | 231 dentries[i].link = calloc(info.block_size, 1); in build_directory_structure() 232 readlink(dentries[i].full_path, dentries[i].link, info.block_size - 1); in build_directory_structure() 331 u32 journal_blocks = DIV_ROUND_UP(info.len, info.block_size) / 64; in compute_journal_blocks() 341 return info.block_size * 8; in compute_blocks_per_group() 346 return DIV_ROUND_UP(info.len, info.block_size) / 4; in compute_inodes() 351 u32 blocks = DIV_ROUND_UP(info.len, info.block_size); in compute_inodes_per_group() 354 inodes = EXT4_ALIGN(inodes, (info.block_size / info.inode_size)); in compute_inodes_per_group() 366 u32 blocks = DIV_ROUND_UP(info.len, info.block_size); in compute_bg_desc_reserve_blocks() 369 info.block_size); in compute_bg_desc_reserve_blocks() 373 info.block_size) - bg_desc_blocks; in compute_bg_desc_reserve_blocks() [all …]
|
D | ext4_sb.c | 31 info->block_size = 1024 << sb->s_log_block_size; in ext4_parse_sb() 44 info->len = (uint64_t)info->block_size * len_blocks; in ext4_parse_sb()
|
D | ext4_sb.h | 32 uint32_t block_size; member
|
D | allocate.c | 180 bg->inode_table = calloc(aux_info.inode_table_blocks, info.block_size); in allocate_bg_inode_table() 185 aux_info.inode_table_blocks * info.block_size, block); in allocate_bg_inode_table() 292 bg->bitmaps = calloc(info.block_size, 2); in init_bg() 294 bg->inode_bitmap = bg->bitmaps + info.block_size; in init_bg() 302 sparse_file_add_data(ext4_sparse_file, bg->bitmaps, 2 * info.block_size, in init_bg() 676 block = calloc(info.block_size, 1); in get_xattr_block_for_inode() 678 error("get_xattr: failed to allocate %d", info.block_size); in get_xattr_block_for_inode() 685 inode->i_blocks_lo = cpu_to_le32(le32_to_cpu(inode->i_blocks_lo) + (info.block_size / 512)); in get_xattr_block_for_inode() 688 int result = sparse_file_add_data(ext4_sparse_file, block, info.block_size, block_num); in get_xattr_block_for_inode()
|
D | make_ext4fs_main.c | 92 info.block_size = parse_num(optarg); in main()
|
/system/core/libsparse/ |
D | sparse.c | 30 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len) in sparse_file_new() argument 37 s->backed_block_list = backed_block_list_new(block_size); in sparse_file_new() 43 s->block_size = block_size; in sparse_file_new() 95 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in sparse_count_chunks() 97 if (last_block < DIV_ROUND_UP(s->len, s->block_size)) { in sparse_count_chunks() 136 write_skip_chunk(out, (int64_t)blocks * s->block_size); in write_all_blocks() 140 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in write_all_blocks() 143 pad = s->len - (int64_t)last_block * s->block_size; in write_all_blocks() 160 out = output_file_open_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc); in sparse_file_write() 180 out = output_file_open_callback(write, priv, s->block_size, s->len, false, in sparse_file_callback() [all …]
|
D | img2simg.c | 52 unsigned int block_size = 4096; in main() local 61 block_size = atoi(argv[3]); in main() 64 if (block_size < 1024 || block_size % 4 != 0) { in main() 92 s = sparse_file_new(block_size, len); in main()
|
D | output_file.c | 86 unsigned int block_size; member 345 if (skip_len % out->block_size) { in write_sparse_skip_chunk() 347 skip_len, out->block_size); in write_sparse_skip_chunk() 354 chunk_header.chunk_sz = skip_len / out->block_size; in write_sparse_skip_chunk() 374 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_fill_chunk() 379 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_fill_chunk() 390 count = out->block_size / sizeof(uint32_t); in write_sparse_fill_chunk() 409 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_data_chunk() 415 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_data_chunk() 479 unsigned int rnd_up_len = ALIGN(len, out->block_size); in write_normal_data_chunk() [all …]
|
D | output_file.h | 24 struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t len, 27 void *priv, unsigned int block_size, int64_t len, int gz, int sparse,
|
D | sparse_read.c | 106 unsigned int len = blocks * s->block_size; in process_raw_chunk() 108 if (chunk_size % s->block_size != 0) { in process_raw_chunk() 112 if (chunk_size / s->block_size != blocks) { in process_raw_chunk() 143 int64_t len = (int64_t)blocks * s->block_size; in process_fill_chunk() 188 int64_t len = (int64_t)blocks * s->block_size; in process_skip_chunk() 359 uint32_t *buf = malloc(s->block_size); in sparse_file_read_normal() 372 to_read = min(remain, s->block_size); in sparse_file_read_normal() 379 if (to_read == s->block_size) { in sparse_file_read_normal() 381 for (i = 1; i < s->block_size / sizeof(uint32_t); i++) { in sparse_file_read_normal()
|
D | backed_block.c | 52 unsigned int block_size; member 123 struct backed_block_list *backed_block_list_new(unsigned int block_size) in backed_block_list_new() argument 126 b->block_size = block_size; in backed_block_list_new() 209 block_len = a->len / bbl->block_size; /* rounds down */ in merge_bb() 366 max_len = ALIGN_DOWN(max_len, bbl->block_size); in backed_block_split() 380 new_bb->block = bb->block + max_len / bbl->block_size; in backed_block_split()
|
D | sparse_file.h | 23 unsigned int block_size; member
|
D | append2simg.c | 101 } else if (input_len % sparse_output->block_size) { in main() 107 output_block = sparse_output->len / sparse_output->block_size; in main()
|
D | backed_block.h | 57 struct backed_block_list *backed_block_list_new(unsigned int block_size);
|
/system/extras/f2fs_utils/ |
D | f2fs_sparseblock.h | 41 u_int32_t block_size; member
|
/system/core/libsparse/include/sparse/ |
D | sparse.h | 42 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len);
|
/system/extras/tests/fstest/ |
D | recovery_test.cpp | 140 int block_size = 1 << (10 + sb.s_log_block_size); in corruptGdtFreeBlock() local 151 if (lseek(blk_fd, block_size, SEEK_SET) == -1) { in corruptGdtFreeBlock()
|
/system/vold/ |
D | cryptfs.c | 385 int fd, block_size; in get_fs_size() local 410 block_size = 1024 << sb.s_log_block_size; in get_fs_size() 412 len = ( ((off64_t)sb.s_blocks_count_hi << 32) + sb.s_blocks_count_lo) * block_size; in get_fs_size() 2272 offset / info.block_size * CRYPT_SECTOR_SIZE); in log_progress() 2279 data->offset / info.block_size * CRYPT_SECTOR_SIZE); in log_progress() 2284 offset = data->offset + (off64_t)data->count * info.block_size; in log_progress() 2297 info.block_size * data->count, data->offset) in flush_outstanding_data() 2305 info.block_size * data->count, data->offset) in flush_outstanding_data() 2316 / info.block_size * CRYPT_SECTOR_SIZE - 1; in flush_outstanding_data() 2328 data->buffer = malloc(info.block_size * BLOCKS_AT_A_TIME); in encrypt_groups() [all …]
|