Home
last modified time | relevance | path

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

/system/extras/ext4_utils/
Dext2simg.c77 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET); in read_ext()
81 ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks); in read_ext()
84 if (ret != (int)info.block_size * (int)aux_info.bg_desc_blocks) in read_ext()
90 printf(" Block size: %d\n", info.block_size); in read_ext()
124 block_bitmap = malloc(info.block_size); in build_sparse_ext()
130 info.block_size * aux_info.first_data_block, 0); in build_sparse_ext()
136 ret = lseek64(fd, (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap, in build_sparse_ext()
141 ret = read(fd, block_bitmap, info.block_size); in build_sparse_ext()
144 if (ret != (int)info.block_size) in build_sparse_ext()
155 (u64)info.block_size * start_block, in build_sparse_ext()
[all …]
Dindirect.c33 if (DIV_ROUND_UP(backing_len, info.block_size) > EXT4_NDIR_BLOCKS) in create_backing()
47 len = min(region_len * info.block_size, backing_len); in create_backing()
125 u32 *ind_block_data = calloc(info.block_size, 1); in fill_dindirect_block()
126 sparse_file_add_data(info.sparse_file, ind_block_data, info.block_size, in fill_dindirect_block()
155 u32 *dind_block_data = calloc(info.block_size, 1); in fill_tindirect_block()
156 sparse_file_add_data(info.sparse_file, dind_block_data, info.block_size, in fill_tindirect_block()
204 u32 *ind_block_data = calloc(info.block_size, 1); in inode_attach_indirect_blocks()
205 sparse_file_add_data(info.sparse_file, ind_block_data, info.block_size, in inode_attach_indirect_blocks()
236 u32 *dind_block_data = calloc(info.block_size, 1); in inode_attach_dindirect_blocks()
237 sparse_file_add_data(info.sparse_file, dind_block_data, info.block_size, in inode_attach_dindirect_blocks()
[all …]
Dext4fixup.c226 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET); in read_ext()
230 ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks); in read_ext()
233 if (ret != (int)info.block_size * (int)aux_info.bg_desc_blocks) in read_ext()
239 printf(" Block size: %d\n", info.block_size); in read_ext()
266 inode_offset = ((unsigned long long)aux_info.bg_desc[bg_num].bg_inode_table * info.block_size) + in read_inode()
286 off = block_num * info.block_size; in read_block()
292 len=read(fd, block, info.block_size); in read_block()
293 if (len != info.block_size) { in read_block()
309 off = block_num * info.block_size; in write_block()
315 len=write(fd, block, info.block_size); in write_block()
[all …]
Dext4_utils.c93 aux_info.first_data_block = (info.block_size > 1024) ? 0 : 1; in ext4_create_fs_aux_info()
94 aux_info.len_blocks = info.len / info.block_size; in ext4_create_fs_aux_info()
96 info.block_size); in ext4_create_fs_aux_info()
99 aux_info.blocks_per_ind = info.block_size / sizeof(u32); in ext4_create_fs_aux_info()
105 info.block_size); in ext4_create_fs_aux_info()
119 aux_info.sb = calloc(info.block_size, 1); in ext4_create_fs_aux_info()
126 aux_info.bg_desc = calloc(info.block_size, aux_info.bg_desc_blocks); in ext4_create_fs_aux_info()
156 sb->s_log_block_size = log_2(info.block_size / 1024); in ext4_fill_in_sb()
157 sb->s_obso_log_frag_size = log_2(info.block_size / 1024); in ext4_fill_in_sb()
227 aux_info.backup_sb[i] = calloc(info.block_size, 1); in ext4_fill_in_sb()
[all …]
Dextent.c44 len = min(region_len * info.block_size, backing_len); in extent_create_backing()
66 len = min(region_len * info.block_size, backing_len); in extent_create_backing_file()
78 u32 block_len = DIV_ROUND_UP(len, info.block_size); in do_inode_allocate_extents()
124 u8 *data = calloc(info.block_size, 1); in do_inode_allocate_extents()
128 sparse_file_add_data(info.sparse_file, data, info.block_size, in do_inode_allocate_extents()
131 if (((int)(info.block_size - sizeof(struct ext4_extent_header) / in do_inode_allocate_extents()
141 hdr->eh_max = (info.block_size - sizeof(struct ext4_extent_header)) / in do_inode_allocate_extents()
165 blocks = (u64)block_len * info.block_size / 512; in do_inode_allocate_extents()
Dcontents.c51 if (len % info.block_size + dentry_len > info.block_size) in dentry_size()
52 len += info.block_size - (len % info.block_size); in dentry_size()
67 u32 start_block = *offset / info.block_size; in add_dentry()
68 u32 end_block = (*offset + rec_len - 1) / info.block_size; in add_dentry()
74 prev->rec_len += end_block * info.block_size - *offset; in add_dentry()
75 *offset = end_block * info.block_size; in add_dentry()
107 blocks = DIV_ROUND_UP(dentry_size(entries, dentries), info.block_size); in make_directory()
108 len = blocks * info.block_size; in make_directory()
229 u8 *data = inode_allocate_data_indirect(inode, info.block_size, info.block_size); in make_link()
231 inode->i_blocks_lo = info.block_size / 512; in make_link()
[all …]
Dmake_ext4fs.c209 dentries[i].link = calloc(info.block_size, 1); in build_directory_structure()
210 readlink(dentries[i].full_path, dentries[i].link, info.block_size - 1); in build_directory_structure()
309 u32 journal_blocks = DIV_ROUND_UP(info.len, info.block_size) / 64; in compute_journal_blocks()
319 return info.block_size * 8; in compute_blocks_per_group()
324 return DIV_ROUND_UP(info.len, info.block_size) / 4; in compute_inodes()
329 u32 blocks = DIV_ROUND_UP(info.len, info.block_size); in compute_inodes_per_group()
332 inodes = ALIGN(inodes, (info.block_size / info.inode_size)); in compute_inodes_per_group()
344 u32 blocks = DIV_ROUND_UP(info.len, info.block_size); in compute_bg_desc_reserve_blocks()
347 info.block_size); in compute_bg_desc_reserve_blocks()
351 info.block_size) - bg_desc_blocks; in compute_bg_desc_reserve_blocks()
[all …]
Dallocate.c180 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(info.sparse_file, bg->bitmaps, 2 * info.block_size, in init_bg()
708 block = calloc(info.block_size, 1); in get_xattr_block_for_inode()
710 error("get_xattr: failed to allocate %d", info.block_size); in get_xattr_block_for_inode()
717 inode->i_blocks_lo = cpu_to_le32(le32_to_cpu(inode->i_blocks_lo) + (info.block_size / 512)); in get_xattr_block_for_inode()
720 int result = sparse_file_add_data(info.sparse_file, block, info.block_size, block_num); in get_xattr_block_for_inode()
Dmake_ext4fs_main.c88 info.block_size = parse_num(optarg); in main()
Dext4_utils.h120 u32 block_size; member
/system/core/libsparse/
Dsparse.c29 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()
94 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in sparse_count_chunks()
96 if (last_block < DIV_ROUND_UP(s->len, s->block_size)) { in sparse_count_chunks()
135 write_skip_chunk(out, (int64_t)blocks * s->block_size); in write_all_blocks()
139 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in write_all_blocks()
142 pad = s->len - (int64_t)last_block * s->block_size; in write_all_blocks()
159 out = output_file_open_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc); in sparse_file_write()
179 out = output_file_open_callback(write, priv, s->block_size, s->len, false, in sparse_file_callback()
[all …]
Dimg2simg.c53 unsigned int block_size = 4096; in main() local
62 block_size = atoi(argv[3]); in main()
65 if (block_size < 1024 || block_size % 4 != 0) { in main()
93 s = sparse_file_new(block_size, len); in main()
Doutput_file.c93 unsigned int block_size; member
353 if (skip_len % out->block_size) { in write_sparse_skip_chunk()
355 skip_len, out->block_size); in write_sparse_skip_chunk()
362 chunk_header.chunk_sz = skip_len / out->block_size; in write_sparse_skip_chunk()
383 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_fill_chunk()
388 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_fill_chunk()
399 count = out->block_size / sizeof(uint32_t); in write_sparse_fill_chunk()
418 rnd_up_len = ALIGN(len, out->block_size); in write_sparse_data_chunk()
424 chunk_header.chunk_sz = rnd_up_len / out->block_size; in write_sparse_data_chunk()
488 unsigned int rnd_up_len = ALIGN(len, out->block_size); in write_normal_data_chunk()
[all …]
Doutput_file.h24 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,
Dsparse_read.c104 unsigned int len = blocks * s->block_size; in process_raw_chunk()
106 if (chunk_size % s->block_size != 0) { in process_raw_chunk()
110 if (chunk_size / s->block_size != blocks) { in process_raw_chunk()
141 int64_t len = (int64_t)blocks * s->block_size; in process_fill_chunk()
182 int64_t len = (int64_t)blocks * s->block_size; in process_skip_chunk()
362 uint32_t *buf = malloc(s->block_size); in sparse_file_read_normal()
376 to_read = min(remain, s->block_size); in sparse_file_read_normal()
383 if (to_read == s->block_size) { in sparse_file_read_normal()
385 for (i = 1; i < s->block_size / sizeof(uint32_t); i++) { in sparse_file_read_normal()
Dbacked_block.c52 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()
Dsparse_file.h23 unsigned int block_size; member
Dbacked_block.h57 struct backed_block_list *backed_block_list_new(unsigned int block_size);
/system/extras/tests/ext4/
Dcorrupt_gdt_free_blocks.c16 int block_size; in main() local
55 block_size = 1 << (10 + sb.s_log_block_size); in main()
67 if (lseek(fd, block_size, SEEK_SET) == -1) { in main()
/system/core/libsparse/include/sparse/
Dsparse.h38 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len);
/system/vold/
Dcryptfs.c89 int fd, block_size; in get_fs_size() local
110 block_size = 1024 << sb.s_log_block_size; in get_fs_size()
112 len = ( ((off64_t)sb.s_blocks_count_hi << 32) + sb.s_blocks_count_lo) * block_size; in get_fs_size()