Lines Matching refs:unit
1407 static inline unsigned long offset_to_bit(u64 bitmap_start, u32 unit, in offset_to_bit() argument
1412 return (unsigned long)(div_u64(offset, unit)); in offset_to_bit()
1415 static inline unsigned long bytes_to_bits(u64 bytes, u32 unit) in bytes_to_bits() argument
1417 return (unsigned long)(div_u64(bytes, unit)); in bytes_to_bits()
1426 bytes_per_bitmap = BITS_PER_BITMAP * ctl->unit; in offset_to_bitmap()
1583 if (entry->offset + BITS_PER_BITMAP * ctl->unit > offset) in tree_search_offset()
1594 ctl->unit > offset) in tree_search_offset()
1647 u32 bytes_per_bg = BITS_PER_BITMAP * ctl->unit; in recalculate_thresholds()
1694 start = offset_to_bit(info->offset, ctl->unit, offset); in __bitmap_clear_bits()
1695 count = bytes_to_bits(bytes, ctl->unit); in __bitmap_clear_bits()
1717 start = offset_to_bit(info->offset, ctl->unit, offset); in bitmap_set_bits()
1718 count = bytes_to_bits(bytes, ctl->unit); in bitmap_set_bits()
1752 i = offset_to_bit(bitmap_info->offset, ctl->unit, in search_bitmap()
1754 bits = bytes_to_bits(*bytes, ctl->unit); in search_bitmap()
1774 *offset = (u64)(i * ctl->unit) + bitmap_info->offset; in search_bitmap()
1775 *bytes = (u64)(found_bits) * ctl->unit; in search_bitmap()
1779 *bytes = (u64)(max_bits) * ctl->unit; in search_bitmap()
1882 end = bitmap_info->offset + (u64)(BITS_PER_BITMAP * ctl->unit) - 1; in remove_from_bitmap()
1891 search_bytes = ctl->unit; in remove_from_bitmap()
1937 search_bytes = ctl->unit; in remove_from_bitmap()
1957 end = info->offset + (u64)(BITS_PER_BITMAP * ctl->unit); in add_bytes_to_bitmap()
2013 if (((BITS_PER_BITMAP * ctl->unit) >> 1) > block_group->key.offset) in use_bitmap()
2201 i = offset_to_bit(bitmap->offset, ctl->unit, end); in steal_from_bitmap_to_end()
2205 bytes = (j - i) * ctl->unit; in steal_from_bitmap_to_end()
2242 i = offset_to_bit(bitmap->offset, ctl->unit, info->offset) - 1; in steal_from_bitmap_to_front()
2254 bytes = (i + 1) * ctl->unit; in steal_from_bitmap_to_front()
2256 bytes = (i - prev_j) * ctl->unit; in steal_from_bitmap_to_front()
2480 ctl->unit = block_group->sectorsize; in btrfs_init_free_space_ctl()
2813 i = offset_to_bit(entry->offset, ctl->unit, in btrfs_bitmap_cluster()
2815 want_bits = bytes_to_bits(bytes, ctl->unit); in btrfs_bitmap_cluster()
2816 min_bits = bytes_to_bits(min_bytes, ctl->unit); in btrfs_bitmap_cluster()
2842 entry->max_extent_size = (u64)max_bits * ctl->unit; in btrfs_bitmap_cluster()
2853 if (cluster->max_size < found_bits * ctl->unit) in btrfs_bitmap_cluster()
2854 cluster->max_size = found_bits * ctl->unit; in btrfs_bitmap_cluster()
2861 cluster->window_start = start * ctl->unit + entry->offset; in btrfs_bitmap_cluster()
2868 total_found * ctl->unit, 1); in btrfs_bitmap_cluster()
3304 offset += BITS_PER_BITMAP * ctl->unit; in trim_bitmaps()
3307 if (start >= offset + BITS_PER_BITMAP * ctl->unit) in trim_bitmaps()
3308 offset += BITS_PER_BITMAP * ctl->unit; in trim_bitmaps()
3653 bit_bytes = ctl->unit; in test_check_exists()