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

/system/core/libsparse/
H A Dsparse_file.h23 unsigned int block_size; member in struct:sparse_file
H A Dimg2simg.c43 fprintf(stderr, "Usage: img2simg <raw_image_file> <sparse_image_file> [<block_size>]\n");
53 unsigned int block_size = 4096; local
62 block_size = atoi(argv[3]);
65 if (block_size < 1024 || block_size % 4 != 0) {
93 s = sparse_file_new(block_size, len);
H A Dsparse.c29 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len) argument
36 s->backed_block_list = backed_block_list_new(block_size);
42 s->block_size = block_size;
94 DIV_ROUND_UP(backed_block_len(bb), s->block_size);
96 if (last_block < DIV_ROUND_UP(s->len, s->block_size)) {
135 write_skip_chunk(out, (int64_t)blocks * s->block_size);
139 DIV_ROUND_UP(backed_block_len(bb), s->block_size);
142 pad = s->len - (int64_t)last_block * s->block_size;
159 out = output_file_open_fd(fd, s->block_size,
[all...]
H A 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,
H A Doutput_file.c93 unsigned int block_size; member in struct:output_file
353 if (skip_len % out->block_size) {
355 skip_len, out->block_size);
362 chunk_header.chunk_sz = skip_len / out->block_size;
383 rnd_up_len = ALIGN(len, out->block_size);
388 chunk_header.chunk_sz = rnd_up_len / out->block_size;
399 count = out->block_size / sizeof(uint32_t);
418 rnd_up_len = ALIGN(len, out->block_size);
424 chunk_header.chunk_sz = rnd_up_len / out->block_size;
488 unsigned int rnd_up_len = ALIGN(len, out->block_size);
552 output_file_init(struct output_file *out, int block_size, int64_t len, bool sparse, int chunks, bool crc) argument
641 output_file_open_callback(int (*write)(void *, const void *, int), void *priv, unsigned int block_size, int64_t len, int gz, int sparse, int chunks, int crc) argument
667 output_file_open_fd(int fd, unsigned int block_size, int64_t len, int gz, int sparse, int chunks, int crc) argument
[all...]
H A Dbacked_block.c52 unsigned int block_size; member in struct:backed_block_list
123 struct backed_block_list *backed_block_list_new(unsigned int block_size) argument
126 b->block_size = block_size;
209 block_len = a->len / bbl->block_size; /* rounds down */
366 max_len = ALIGN_DOWN(max_len, bbl->block_size);
380 new_bb->block = bb->block + max_len / bbl->block_size;
H A Dsparse_read.c104 unsigned int len = blocks * s->block_size;
106 if (chunk_size % s->block_size != 0) {
110 if (chunk_size / s->block_size != blocks) {
141 int64_t len = (int64_t)blocks * s->block_size;
182 int64_t len = (int64_t)blocks * s->block_size;
362 uint32_t *buf = malloc(s->block_size);
376 to_read = min(remain, s->block_size);
383 if (to_read == s->block_size) {
385 for (i = 1; i < s->block_size / sizeof(uint32_t); i++) {
H A Dbacked_block.h57 struct backed_block_list *backed_block_list_new(unsigned int block_size);
/system/extras/ext4_utils/
H A Dext2simg.c78 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET);
82 ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks);
85 if (ret != (int)info.block_size * (int)aux_info.bg_desc_blocks)
91 printf(" Block size: %d\n", info.block_size);
125 block_bitmap = malloc(info.block_size);
131 info.block_size * aux_info.first_data_block, 0);
137 ret = lseek64(fd, (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap,
142 ret = read(fd, block_bitmap, info.block_size);
145 if (ret != (int)info.block_size)
156 (u64)info.block_size * start_bloc
[all...]
H A Dcontents.c42 if (len % info.block_size + dentry_len > info.block_size)
43 len += info.block_size - (len % info.block_size);
48 if (len % info.block_size + 8 > info.block_size)
49 len += info.block_size - (len % info.block_size);
63 u32 start_block = *offset / info.block_size;
64 u32 end_block = (*offset + rec_len - 1) / info.block_size;
[all...]
H A Dext4_utils.c92 aux_info.first_data_block = (info.block_size > 1024) ? 0 : 1;
93 aux_info.len_blocks = info.len / info.block_size;
95 info.block_size);
98 aux_info.blocks_per_ind = info.block_size / sizeof(u32);
104 info.block_size);
118 aux_info.sb = calloc(info.block_size, 1);
125 aux_info.bg_desc = calloc(info.block_size, aux_info.bg_desc_blocks);
154 sb->s_log_block_size = log_2(info.block_size / 1024);
155 sb->s_obso_log_frag_size = log_2(info.block_size / 1024);
225 aux_info.backup_sb[i] = calloc(info.block_size,
[all...]
H A Dindirect.c33 if (DIV_ROUND_UP(backing_len, info.block_size) > EXT4_NDIR_BLOCKS)
47 len = min(region_len * info.block_size, backing_len);
125 u32 *ind_block_data = calloc(info.block_size, 1);
126 sparse_file_add_data(info.sparse_file, ind_block_data, info.block_size,
155 u32 *dind_block_data = calloc(info.block_size, 1);
156 sparse_file_add_data(info.sparse_file, dind_block_data, info.block_size,
204 u32 *ind_block_data = calloc(info.block_size, 1);
205 sparse_file_add_data(info.sparse_file, ind_block_data, info.block_size,
236 u32 *dind_block_data = calloc(info.block_size, 1);
237 sparse_file_add_data(info.sparse_file, dind_block_data, info.block_size,
[all...]
H A Dext4fixup.c227 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET);
231 ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks);
234 if (ret != (int)info.block_size * (int)aux_info.bg_desc_blocks)
240 printf(" Block size: %d\n", info.block_size);
267 inode_offset = ((unsigned long long)aux_info.bg_desc[bg_num].bg_inode_table * info.block_size) +
287 off = block_num * info.block_size;
293 len=read(fd, block, info.block_size);
294 if (len != info.block_size) {
310 off = block_num * info.block_size;
316 len=write(fd, block, info.block_size);
[all...]
H A Dmake_ext4fs.c188 dentries[i].link = calloc(info.block_size, 1);
189 readlink(dentries[i].full_path, dentries[i].link, info.block_size - 1);
242 u32 journal_blocks = DIV_ROUND_UP(info.len, info.block_size) / 64;
252 return info.block_size * 8;
257 return DIV_ROUND_UP(info.len, info.block_size) / 4;
262 u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
265 inodes = ALIGN(inodes, (info.block_size / info.inode_size));
277 u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
280 info.block_size);
284 info.block_size)
[all...]
H A Dextent.c44 len = min(region_len * info.block_size, backing_len);
66 len = min(region_len * info.block_size, backing_len);
78 u32 block_len = DIV_ROUND_UP(len, info.block_size);
124 u8 *data = calloc(info.block_size, 1);
128 sparse_file_add_data(info.sparse_file, data, info.block_size,
131 if (((int)(info.block_size - sizeof(struct ext4_extent_header) /
141 hdr->eh_max = (info.block_size - sizeof(struct ext4_extent_header)) /
165 blocks = (u64)block_len * info.block_size / 512;
H A Dmake_ext4fs_main.c42 fprintf(stderr, "%s [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]\n", basename(path));
78 info.block_size = parse_num(optarg);
H A Dext4_utils.h110 u32 block_size; member in struct:fs_info
H A Dallocate.c154 bg->inode_table = calloc(aux_info.inode_table_blocks, info.block_size);
159 aux_info.inode_table_blocks * info.block_size, block);
175 aux_info.inode_table_blocks * info.block_size, block);
282 bg->bitmaps = calloc(info.block_size, 2);
284 bg->inode_bitmap = bg->bitmaps + info.block_size;
292 sparse_file_add_data(info.sparse_file, bg->bitmaps, 2 * info.block_size,
/system/extras/tests/ext4/
H A Dcorrupt_gdt_free_blocks.c16 int block_size; local
55 block_size = 1 << (10 + sb.s_log_block_size);
67 if (lseek(fd, block_size, SEEK_SET) == -1) {
/system/core/libsparse/include/sparse/
H A Dsparse.h28 * @block_size - minimum size of a chunk
33 * block_size specifies the minimum size of a chunk in the file. The maximum
34 * size of the file is 2**32 * block_size (16TB for 4k block size).
38 struct sparse_file *sparse_file_new(unsigned int block_size, int64_t len);
59 * [block * block_size : block * block_size + len) must not already be used in
80 * The region [block * block_size : block * block_size + len) must not already
99 * The region [block * block_size : block * block_size
[all...]
/system/vold/
H A Dcryptfs.c89 int fd, block_size; local
110 block_size = 1024 << sb.s_log_block_size;
112 len = ( ((off64_t)sb.s_blocks_count_hi << 32) + sb.s_blocks_count_lo) * block_size;

Completed in 120 milliseconds