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,
316 blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
318 u_daddr_t orig = scan->u.bmu_bitmap;
326 scan->bm_bighint = 0;
347 scan->u.bmu_bitmap &= ~(1 << r);
366 scan->u.bmu_bitmap &= ~mask;
375 scan->bm_bighint = count - 1;
389 blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix,
395 if (scan->u.bmu_avail == 0) {
399 scan->bm_bighint = count;
403 if (scan->u.bmu_avail == radix) {
411 if (scan[i].bm_bighint == (daddr_t)-1)
414 scan[i].u.bmu_bitmap = (u_daddr_t)-1;
415 scan[i].bm_bighint = BLIST_BMAP_RADIX;
417 scan[i].bm_bighint = radix;
418 scan[i].u.bmu_avail = radix;
426 if (count <= scan[i].bm_bighint) {
432 r = blst_leaf_alloc(&scan[i], blk, count);
434 r = blst_meta_alloc(&scan[i], blk, count,
437 scan->u.bmu_avail -= count;
438 if (scan->bm_bighint > scan->u.bmu_avail)
439 scan->bm_bighint = scan->u.bmu_avail;
442 } else if (scan[i].bm_bighint == (daddr_t)-1) {
460 if (scan->bm_bighint >= count)
461 scan->bm_bighint = count - 1;
471 blst_leaf_free(blmeta_t *scan, daddr_t blk, int count)
487 if (scan->u.bmu_bitmap & mask)
489 scan->u.bmu_bitmap |= mask;
497 scan->bm_bighint = BLIST_BMAP_RADIX;
512 blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix,
525 if (scan->u.bmu_avail == 0) {
530 scan->u.bmu_avail = count;
531 scan->bm_bighint = count;
535 if (scan[i].bm_bighint == (daddr_t)-1)
537 scan[i].bm_bighint = 0;
539 scan[i].u.bmu_bitmap = 0;
541 scan[i].u.bmu_avail = 0;
546 scan->u.bmu_avail += count;
547 /* scan->bm_bighint = radix; */
554 if (scan->u.bmu_avail == radix)
556 if (scan->u.bmu_avail > radix)
557 panic("blst_meta_free: freeing already free blocks (%d) %d/%d", count, scan->u.bmu_avail, radix);
576 if (scan->bm_bighint == (daddr_t)-1)
580 blst_leaf_free(&scan[i], freeBlk, v);
582 blst_meta_free(&scan[i], freeBlk, v, radix,
584 if (scan->bm_bighint < scan[i].bm_bighint)
585 scan->bm_bighint = scan[i].bm_bighint;
600 static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
611 u_daddr_t v = scan->u.bmu_bitmap;
632 if (scan->u.bmu_avail == 0)
634 if (scan->u.bmu_avail == radix) {
649 if (scan[i].bm_bighint == (daddr_t)-1)
654 &scan[i],
665 &scan[i],
689 blst_radix_init(blmeta_t *scan, daddr_t radix, int skip, daddr_t count)
700 if (scan) {
701 scan->bm_bighint = 0;
702 scan->u.bmu_bitmap = 0;
713 if (scan) {
714 scan->bm_bighint = 0;
715 scan->u.bmu_avail = 0;
727 ((scan) ? &scan[i] : NULL),
738 ((scan) ? &scan[i] : NULL),
748 if (scan)
749 scan[i].bm_bighint = (daddr_t)-1;
761 blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int skip, int tab)
772 scan->u.bmu_bitmap,
773 scan->bm_bighint
778 if (scan->u.bmu_avail == 0) {
787 if (scan->u.bmu_avail == radix) {
801 scan->u.bmu_avail,
803 scan->bm_bighint
811 if (scan[i].bm_bighint == (daddr_t)-1) {
821 &scan[i],