Lines Matching refs:chunk_start
66 static void add_chunk(ext2_filsys fs, struct sparse_file *s, blk_t chunk_start, blk_t chunk_end) in add_chunk() argument
69 unsigned int nb_blk = chunk_end - chunk_start; in add_chunk()
71 int64_t offset = (int64_t)chunk_start * (int64_t)fs->blocksize; in add_chunk()
74 if (sparse_file_add_file(s, params.in_file, offset, len, chunk_start) < 0) in add_chunk()
89 retval = io_channel_read_blk64(fs->io, chunk_start, nb_blk, bi->buf); in add_chunk()
91 ext2fs_fatal(retval, "reading block %u - %u", chunk_start, chunk_end); in add_chunk()
93 if (sparse_file_add_data(s, bi->buf, len, chunk_start) < 0) in add_chunk()
114 int64_t chunk_start = -1; in ext_to_sparse() local
146 if (chunk_start == -1) { in ext_to_sparse()
147 chunk_start = cur_blk; in ext_to_sparse()
148 } else if (cur_blk - chunk_start + 1 == max_blk_per_chunk) { in ext_to_sparse()
149 add_chunk(fs, s, chunk_start, cur_blk); in ext_to_sparse()
150 chunk_start = -1; in ext_to_sparse()
152 } else if (chunk_start != -1) { in ext_to_sparse()
153 add_chunk(fs, s, chunk_start, cur_blk); in ext_to_sparse()
154 chunk_start = -1; in ext_to_sparse()
157 if (chunk_start != -1) in ext_to_sparse()
158 add_chunk(fs, s, chunk_start, cur_blk - 1); in ext_to_sparse()