Lines Matching refs:unit
1409 static inline unsigned long offset_to_bit(u64 bitmap_start, u32 unit, in offset_to_bit() argument
1414 return (unsigned long)(div_u64(offset, unit)); in offset_to_bit()
1417 static inline unsigned long bytes_to_bits(u64 bytes, u32 unit) in bytes_to_bits() argument
1419 return (unsigned long)(div_u64(bytes, unit)); in bytes_to_bits()
1428 bytes_per_bitmap = BITS_PER_BITMAP * ctl->unit; in offset_to_bitmap()
1585 if (entry->offset + BITS_PER_BITMAP * ctl->unit > offset) in tree_search_offset()
1596 ctl->unit > offset) in tree_search_offset()
1649 u32 bytes_per_bg = BITS_PER_BITMAP * ctl->unit; in recalculate_thresholds()
1696 start = offset_to_bit(info->offset, ctl->unit, offset); in __bitmap_clear_bits()
1697 count = bytes_to_bits(bytes, ctl->unit); in __bitmap_clear_bits()
1719 start = offset_to_bit(info->offset, ctl->unit, offset); in bitmap_set_bits()
1720 count = bytes_to_bits(bytes, ctl->unit); in bitmap_set_bits()
1743 i = offset_to_bit(bitmap_info->offset, ctl->unit, in search_bitmap()
1745 bits = bytes_to_bits(*bytes, ctl->unit); in search_bitmap()
1761 *offset = (u64)(i * ctl->unit) + bitmap_info->offset; in search_bitmap()
1762 *bytes = (u64)(found_bits) * ctl->unit; in search_bitmap()
1766 *bytes = (u64)(max_bits) * ctl->unit; in search_bitmap()
1868 end = bitmap_info->offset + (u64)(BITS_PER_BITMAP * ctl->unit) - 1; in remove_from_bitmap()
1877 search_bytes = ctl->unit; in remove_from_bitmap()
1922 search_bytes = ctl->unit; in remove_from_bitmap()
1942 end = info->offset + (u64)(BITS_PER_BITMAP * ctl->unit); in add_bytes_to_bitmap()
1985 if (((BITS_PER_BITMAP * ctl->unit) >> 1) > block_group->key.offset) in use_bitmap()
2173 i = offset_to_bit(bitmap->offset, ctl->unit, end); in steal_from_bitmap_to_end()
2177 bytes = (j - i) * ctl->unit; in steal_from_bitmap_to_end()
2214 i = offset_to_bit(bitmap->offset, ctl->unit, info->offset) - 1; in steal_from_bitmap_to_front()
2226 bytes = (i + 1) * ctl->unit; in steal_from_bitmap_to_front()
2228 bytes = (i - prev_j) * ctl->unit; in steal_from_bitmap_to_front()
2452 ctl->unit = block_group->sectorsize; in btrfs_init_free_space_ctl()
2784 i = offset_to_bit(entry->offset, ctl->unit, in btrfs_bitmap_cluster()
2786 want_bits = bytes_to_bits(bytes, ctl->unit); in btrfs_bitmap_cluster()
2787 min_bits = bytes_to_bits(min_bytes, ctl->unit); in btrfs_bitmap_cluster()
2811 if (cluster->max_size < found_bits * ctl->unit) in btrfs_bitmap_cluster()
2812 cluster->max_size = found_bits * ctl->unit; in btrfs_bitmap_cluster()
2819 cluster->window_start = start * ctl->unit + entry->offset; in btrfs_bitmap_cluster()
2826 total_found * ctl->unit, 1); in btrfs_bitmap_cluster()
3259 offset += BITS_PER_BITMAP * ctl->unit; in trim_bitmaps()
3262 if (start >= offset + BITS_PER_BITMAP * ctl->unit) in trim_bitmaps()
3263 offset += BITS_PER_BITMAP * ctl->unit; in trim_bitmaps()
3597 bit_bytes = ctl->unit; in test_check_exists()