Home | History | Annotate | Download | only in libsparse

Lines Matching refs:bbl

55 struct backed_block *backed_block_iter_new(struct backed_block_list *bbl)
57 return bbl->data_blocks;
130 void backed_block_list_destroy(struct backed_block_list *bbl)
132 if (bbl->data_blocks) {
133 struct backed_block *bb = bbl->data_blocks;
141 free(bbl);
191 static int merge_bb(struct backed_block_list *bbl,
209 block_len = a->len / bbl->block_size; /* rounds down */
247 static int queue_bb(struct backed_block_list *bbl, struct backed_block *new_bb)
251 if (bbl->data_blocks == NULL) {
252 bbl->data_blocks = new_bb;
256 if (bbl->data_blocks->block > new_bb->block) {
257 new_bb->next = bbl->data_blocks;
258 bbl->data_blocks = new_bb;
265 if (bbl->last_used && new_bb->block > bbl->last_used->block)
266 bb = bbl->last_used;
268 bb = bbl->data_blocks;
269 bbl->last_used = new_bb;
281 merge_bb(bbl, new_bb, new_bb->next);
282 merge_bb(bbl, bb, new_bb);
288 int backed_block_add_fill(struct backed_block_list *bbl, unsigned int fill_val,
302 return queue_bb(bbl, bb);
306 int backed_block_add_data(struct backed_block_list *bbl, void *data,
320 return queue_bb(bbl, bb);
324 int backed_block_add_file(struct backed_block_list *bbl, const char *filename,
339 return queue_bb(bbl, bb);
343 int backed_block_add_fd(struct backed_block_list *bbl, int fd, int64_t offset,
358 return queue_bb(bbl, bb);
361 int backed_block_split(struct backed_block_list *bbl, struct backed_block *bb,
366 max_len = ALIGN_DOWN(max_len, bbl->block_size);
380 new_bb->block = bb->block + max_len / bbl->block_size;