Lines Matching refs:bb
83 struct backed_block *bb; in sparse_count_chunks() local
87 for (bb = backed_block_iter_new(s->backed_block_list); bb; in sparse_count_chunks()
88 bb = backed_block_iter_next(bb)) { in sparse_count_chunks()
89 if (backed_block_block(bb) > last_block) { in sparse_count_chunks()
94 last_block = backed_block_block(bb) + in sparse_count_chunks()
95 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in sparse_count_chunks()
105 struct backed_block *bb) in sparse_file_write_block() argument
109 switch (backed_block_type(bb)) { in sparse_file_write_block()
111 ret = write_data_chunk(out, backed_block_len(bb), backed_block_data(bb)); in sparse_file_write_block()
114 ret = write_file_chunk(out, backed_block_len(bb), in sparse_file_write_block()
115 backed_block_filename(bb), in sparse_file_write_block()
116 backed_block_file_offset(bb)); in sparse_file_write_block()
119 ret = write_fd_chunk(out, backed_block_len(bb), in sparse_file_write_block()
120 backed_block_fd(bb), in sparse_file_write_block()
121 backed_block_file_offset(bb)); in sparse_file_write_block()
124 ret = write_fill_chunk(out, backed_block_len(bb), in sparse_file_write_block()
125 backed_block_fill_val(bb)); in sparse_file_write_block()
134 struct backed_block *bb; in write_all_blocks() local
139 for (bb = backed_block_iter_new(s->backed_block_list); bb; in write_all_blocks()
140 bb = backed_block_iter_next(bb)) { in write_all_blocks()
141 if (backed_block_block(bb) > last_block) { in write_all_blocks()
142 unsigned int blocks = backed_block_block(bb) - last_block; in write_all_blocks()
145 ret = sparse_file_write_block(out, bb); in write_all_blocks()
148 last_block = backed_block_block(bb) + in write_all_blocks()
149 DIV_ROUND_UP(backed_block_len(bb), s->block_size); in write_all_blocks()
239 struct backed_block *bb; in move_chunks_up_to_len() local
260 for (bb = start; bb; bb = backed_block_iter_next(bb)) { in move_chunks_up_to_len()
262 if (backed_block_block(bb) > last_block) in move_chunks_up_to_len()
264 last_block = backed_block_block(bb) + in move_chunks_up_to_len()
265 DIV_ROUND_UP(backed_block_len(bb), to->block_size); in move_chunks_up_to_len()
268 ret = sparse_file_write_block(out_counter, bb); in move_chunks_up_to_len()
270 bb = NULL; in move_chunks_up_to_len()
281 backed_block_split(from->backed_block_list, bb, len - file_len); in move_chunks_up_to_len()
282 last_bb = bb; in move_chunks_up_to_len()
287 last_bb = bb; in move_chunks_up_to_len()
297 return bb; in move_chunks_up_to_len()
303 struct backed_block *bb; in sparse_file_resparse() local
316 bb = move_chunks_up_to_len(in_s, s, max_len); in sparse_file_resparse()
326 } while (bb); in sparse_file_resparse()