Lines Matching defs:bl
164 blist_t bl;
178 bl = malloc(sizeof(struct blist), M_SWAP, M_WAITOK);
180 bzero(bl, sizeof(*bl));
182 bl->bl_blocks = blocks;
183 bl->bl_radix = radix;
184 bl->bl_skip = skip;
185 bl->bl_rootblks = 1 +
186 blst_radix_init(NULL, bl->bl_radix, bl->bl_skip, blocks);
187 bl->bl_root = malloc(sizeof(blmeta_t) * bl->bl_rootblks, M_SWAP, M_WAITOK);
193 bl->bl_blocks,
194 bl->bl_blocks * 4 / 1024,
195 (bl->bl_rootblks * sizeof(blmeta_t) + 1023) / 1024
197 printf("BLIST raw radix tree contains %d records\n", bl->bl_rootblks);
199 blst_radix_init(bl->bl_root, bl->bl_radix, bl->bl_skip, blocks);
201 return(bl);
205 blist_destroy(blist_t bl)
207 free(bl->bl_root, M_SWAP);
208 free(bl, M_SWAP);
218 blist_alloc(blist_t bl, daddr_t count)
222 if (bl) {
223 if (bl->bl_radix == BLIST_BMAP_RADIX)
224 blk = blst_leaf_alloc(bl->bl_root, 0, count);
226 blk = blst_meta_alloc(bl->bl_root, 0, count,
227 bl->bl_radix, bl->bl_skip);
229 bl->bl_free -= count;
241 blist_free(blist_t bl, daddr_t blkno, daddr_t count)
243 if (bl) {
244 if (bl->bl_radix == BLIST_BMAP_RADIX)
245 blst_leaf_free(bl->bl_root, blkno, count);
247 blst_meta_free(bl->bl_root, blkno, count,
248 bl->bl_radix, bl->bl_skip, 0);
249 bl->bl_free += count;
287 blist_print(blist_t bl)
290 blst_radix_print(bl->bl_root, 0, bl->bl_radix, bl->bl_skip, 4);
846 blist_t bl;
858 bl = blist_create(size);
859 blist_free(bl, 0, size);
867 printf("%d/%d/%d> ", bl->bl_free, size, bl->bl_radix);
874 blist_resize(&bl, count, 1);
879 blist_print(bl);
883 daddr_t blk = blist_alloc(bl, count);
891 blist_free(bl, da, count);