Home | History | Annotate | Download | only in block

Lines Matching refs:chunk

31     /* each chunk contains a certain number of sectors,
33 * lengths[i] is the length of the compressed chunk,
35 * sectorcounts[i] is the number of sectors in that chunk,
217 uint32_t chunk = search_chunk(s,sector_num);
219 if(chunk>=s->n_chunks)
223 switch(s->types[chunk]) {
227 /* we need to buffer, because only the chunk as whole can be
231 ret = bdrv_pread(bs->file, s->offsets[chunk] + i,
232 s->compressed_chunk+i, s->lengths[chunk]-i);
236 } while(ret>=0 && ret+i<s->lengths[chunk]);
238 if (ret != s->lengths[chunk])
242 s->zstream.avail_in = s->lengths[chunk];
244 s->zstream.avail_out = 512*s->sectorcounts[chunk];
249 if(ret != Z_STREAM_END || s->zstream.total_out != 512*s->sectorcounts[chunk])
253 ret = bdrv_pread(bs->file, s->offsets[chunk],
254 s->uncompressed_chunk, s->lengths[chunk]);
255 if (ret != s->lengths[chunk])
259 memset(s->uncompressed_chunk, 0, 512*s->sectorcounts[chunk]);
262 s->current_chunk = chunk;