Lines Matching refs:scan
48 * set to -1) on the scan. The memory allocation is only large enough
132 static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count);
133 static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk,
135 static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count);
136 static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count,
138 static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
140 static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix,
143 static void blst_radix_print(blmeta_t *scan, daddr_t blk,
318 blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
320 u_daddr_t orig = scan->u.bmu_bitmap;
328 scan->bm_bighint = 0;
349 scan->u.bmu_bitmap &= ~(1 << r);
372 scan->u.bmu_bitmap &= ~mask;
381 scan->bm_bighint = count - 1;
395 blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix,
401 if (scan->u.bmu_avail == 0) {
405 scan->bm_bighint = count;
409 if (scan->u.bmu_avail == radix) {
417 if (scan[i].bm_bighint == (daddr_t)-1)
420 scan[i].u.bmu_bitmap = (u_daddr_t)-1;
421 scan[i].bm_bighint = BLIST_BMAP_RADIX;
423 scan[i].bm_bighint = radix;
424 scan[i].u.bmu_avail = radix;
432 if (count <= scan[i].bm_bighint) {
438 r = blst_leaf_alloc(&scan[i], blk, count);
440 r = blst_meta_alloc(&scan[i], blk, count,
443 scan->u.bmu_avail -= count;
444 if (scan->bm_bighint > scan->u.bmu_avail)
445 scan->bm_bighint = scan->u.bmu_avail;
448 } else if (scan[i].bm_bighint == (daddr_t)-1) {
466 if (scan->bm_bighint >= count)
467 scan->bm_bighint = count - 1;
477 blst_leaf_free(blmeta_t *scan, daddr_t blk, int count)
493 if (scan->u.bmu_bitmap & mask)
495 scan->u.bmu_bitmap |= mask;
503 scan->bm_bighint = BLIST_BMAP_RADIX;
518 blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix,
531 if (scan->u.bmu_avail == 0) {
536 scan->u.bmu_avail = count;
537 scan->bm_bighint = count;
541 if (scan[i].bm_bighint == (daddr_t)-1)
543 scan[i].bm_bighint = 0;
545 scan[i].u.bmu_bitmap = 0;
547 scan[i].u.bmu_avail = 0;
552 scan->u.bmu_avail += count;
553 /* scan->bm_bighint = radix; */
560 if (scan->u.bmu_avail == radix)
562 if (scan->u.bmu_avail > radix)
563 panic("blst_meta_free: freeing already free blocks (%d) %d/%d", count, scan->u.bmu_avail, radix);
582 if (scan->bm_bighint == (daddr_t)-1)
586 blst_leaf_free(&scan[i], freeBlk, v);
588 blst_meta_free(&scan[i], freeBlk, v, radix,
590 if (scan->bm_bighint < scan[i].bm_bighint)
591 scan->bm_bighint = scan[i].bm_bighint;
606 static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
617 u_daddr_t v = scan->u.bmu_bitmap;
646 if (scan->u.bmu_avail == 0)
648 if (scan->u.bmu_avail == radix) {
663 if (scan[i].bm_bighint == (daddr_t)-1)
668 &scan[i],
679 &scan[i],
703 blst_radix_init(blmeta_t *scan, daddr_t radix, int skip, daddr_t count)
714 if (scan) {
715 scan->bm_bighint = 0;
716 scan->u.bmu_bitmap = 0;
727 if (scan) {
728 scan->bm_bighint = 0;
729 scan->u.bmu_avail = 0;
741 ((scan) ? &scan[i] : NULL),
752 ((scan) ? &scan[i] : NULL),
762 if (scan)
763 scan[i].bm_bighint = (daddr_t)-1;
775 blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int skip, int tab)
786 scan->u.bmu_bitmap,
787 scan->bm_bighint
792 if (scan->u.bmu_avail == 0) {
801 if (scan->u.bmu_avail == radix) {
815 scan->u.bmu_avail,
817 scan->bm_bighint
825 if (scan[i].bm_bighint == (daddr_t)-1) {
835 &scan[i],