Lines Matching refs:blk

130 static daddr_t	blst_leaf_alloc(blmeta_t *scan, daddr_t blk,
137 static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
139 static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count);
143 static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix,
265 daddr_t blk, cursor; in blist_alloc() local
279 blk = blst_meta_alloc(bl->bl_root, cursor, count, maxcount, in blist_alloc()
281 if (blk != SWAPBLK_NONE) { in blist_alloc()
283 bl->bl_cursor = blk + *count; in blist_alloc()
286 return (blk); in blist_alloc()
590 daddr_t blk; in blst_next_leaf_alloc() local
594 for (blk = start; blk - start < maxcount; blk += BLIST_RADIX) { in blst_next_leaf_alloc()
598 ((blk / radix) & BLIST_MASK) == 0) in blst_next_leaf_alloc()
607 avail = blk - start + bitpos(~scan->bm_bitmap); in blst_next_leaf_alloc()
626 blk -= BLIST_RADIX; in blst_next_leaf_alloc()
642 blk -= BLIST_RADIX; in blst_next_leaf_alloc()
644 (digit = ((blk / radix) & BLIST_MASK)) == 0; in blst_next_leaf_alloc()
653 if (blk == start) in blst_next_leaf_alloc()
669 blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *count, int maxcount) in blst_leaf_alloc() argument
702 if ((blk & BLIST_MASK) != 0) { in blst_leaf_alloc()
703 if ((~mask & bitrange(0, blk & BLIST_MASK)) != 0) { in blst_leaf_alloc()
705 bighint += blk & BLIST_MASK; in blst_leaf_alloc()
706 mask |= bitrange(0, blk & BLIST_MASK); in blst_leaf_alloc()
712 blk -= blk & BLIST_MASK; in blst_leaf_alloc()
742 hi = blst_next_leaf_alloc(scan, blk, count1, maxcount); in blst_leaf_alloc()
759 return (blk + lo); in blst_leaf_alloc()
774 daddr_t blk, i, r, skip; in blst_meta_alloc() local
781 blk = cursor & -(radix * BLIST_RADIX); in blst_meta_alloc()
782 scan_from_start = (cursor == blk); in blst_meta_alloc()
800 cursor = blk; in blst_meta_alloc()
820 cursor = blk; in blst_meta_alloc()
839 blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) in blst_leaf_free() argument
849 mask = bitrange(blk & BLIST_MASK, count); in blst_leaf_free()
852 (uintmax_t)blk, count, (uintmax_t)scan->bm_bitmap & mask)); in blst_leaf_free()
869 daddr_t blk, endBlk, i, skip; in blst_meta_free() local
884 blk = (freeBlk + radix * BLIST_RADIX) & -(radix * BLIST_RADIX); in blst_meta_free()
889 if (blk != 0) in blst_meta_free()
890 endBlk = ummin(endBlk, blk); in blst_meta_free()
892 blk = freeBlk & -radix; in blst_meta_free()
893 digit = (blk / radix) & BLIST_MASK; in blst_meta_free()
896 for (i = 1 + digit * skip; blk < endBlk; i += skip) { in blst_meta_free()
897 blk += radix; in blst_meta_free()
898 count = ummin(blk, endBlk) - freeBlk; in blst_meta_free()
900 freeBlk = blk; in blst_meta_free()
911 blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, in blst_copy() argument
924 blist_free(dest, blk, count); in blst_copy()
930 blist_free(dest, blk + i, 1); in blst_copy()
947 endBlk = blk + count; in blst_copy()
949 for (i = 1; blk < endBlk; i += skip) { in blst_copy()
950 blk += radix; in blst_copy()
952 if (blk >= endBlk) in blst_copy()
953 count -= blk - endBlk; in blst_copy()
954 blst_copy(&scan[i], blk - radix, in blst_copy()
967 blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) in blst_leaf_fill() argument
972 mask = bitrange(blk & BLIST_MASK, count); in blst_leaf_fill()
992 daddr_t blk, endBlk, i, nblks, skip; in blst_meta_fill() local
999 blk = (allocBlk + radix * BLIST_RADIX) & -(radix * BLIST_RADIX); in blst_meta_fill()
1004 if (blk != 0) in blst_meta_fill()
1005 endBlk = ummin(endBlk, blk); in blst_meta_fill()
1007 blk = allocBlk & -radix; in blst_meta_fill()
1009 while (blk < endBlk) { in blst_meta_fill()
1010 digit = (blk / radix) & BLIST_MASK; in blst_meta_fill()
1012 blk += radix; in blst_meta_fill()
1013 count = ummin(blk, endBlk) - allocBlk; in blst_meta_fill()
1018 allocBlk = blk; in blst_meta_fill()
1026 blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) in blst_radix_print() argument
1036 (long long)blk, (long long)BLIST_RADIX, in blst_radix_print()
1047 (long long)blk, (long long)radix * BLIST_RADIX, in blst_radix_print()
1061 blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, in blst_radix_print()
1130 daddr_t blk = blist_alloc(bl, &count, maxcount); in main() local
1132 (long long)blk, count); in main()