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 */
248 static int queue_bb(struct backed_block_list *bbl, struct backed_block *new_bb)
252 if (bbl->data_blocks == NULL) {
253 bbl->data_blocks = new_bb;
257 if (bbl->data_blocks->block > new_bb->block) {
258 new_bb->next = bbl->data_blocks;
259 bbl->data_blocks = new_bb;
266 if (bbl->last_used && new_bb->block > bbl->last_used->block)
267 bb = bbl->last_used;
269 bb = bbl->data_blocks;
270 bbl->last_used = new_bb;
282 merge_bb(bbl, new_bb, new_bb->next);
283 if (!merge_bb(bbl, bb, new_bb)) {
285 bbl->last_used = bb;
292 int backed_block_add_fill(struct backed_block_list *bbl, unsigned int fill_val,
306 return queue_bb(bbl, bb);
310 int backed_block_add_data(struct backed_block_list *bbl, void *data,
324 return queue_bb(bbl, bb);
328 int backed_block_add_file(struct backed_block_list *bbl, const char *filename,
343 return queue_bb(bbl, bb);
347 int backed_block_add_fd(struct backed_block_list *bbl, int fd, int64_t offset,
362 return queue_bb(bbl, bb);
365 int backed_block_split(struct backed_block_list *bbl, struct backed_block *bb,
370 max_len = ALIGN_DOWN(max_len, bbl->block_size);
384 new_bb->block = bb->block + max_len / bbl->block_size;