Lines Matching refs:order
513 static void *mb_find_buddy(struct ext4_buddy *e4b, int order, int *max) in mb_find_buddy() argument
520 if (order > e4b->bd_blkbits + 1) { in mb_find_buddy()
526 if (order == 0) { in mb_find_buddy()
531 bb = e4b->bd_buddy + EXT4_SB(e4b->bd_sb)->s_mb_offsets[order]; in mb_find_buddy()
532 *max = EXT4_SB(e4b->bd_sb)->s_mb_maxs[order]; in mb_find_buddy()
670 int order = e4b->bd_blkbits + 1; in __mb_check_buddy() local
687 while (order > 1) { in __mb_check_buddy()
688 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
690 buddy2 = mb_find_buddy(e4b, order - 1, &max2); in __mb_check_buddy()
714 for (j = 0; j < (1 << order); j++) { in __mb_check_buddy()
715 k = (i * (1 << order)) + j; in __mb_check_buddy()
721 MB_CHECK_ASSERT(e4b->bd_info->bb_counters[order] == count); in __mb_check_buddy()
722 order--; in __mb_check_buddy()
1174 int order = 1; in mb_regenerate_buddy() local
1177 while ((buddy = mb_find_buddy(e4b, order++, &count))) in mb_regenerate_buddy()
1667 int order = 1, max; in mb_find_order_for_block() local
1673 while (order <= e4b->bd_blkbits + 1) { in mb_find_order_for_block()
1674 bb = mb_find_buddy(e4b, order, &max); in mb_find_order_for_block()
1675 if (!mb_test_bit(block >> order, bb)) { in mb_find_order_for_block()
1677 return order; in mb_find_order_for_block()
1679 order++; in mb_find_order_for_block()
1764 int order = 1; in mb_buddy_mark_free() local
1765 void *buddy = mb_find_buddy(e4b, order, &max); in mb_buddy_mark_free()
1800 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&first, buddy, -1); in mb_buddy_mark_free()
1802 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&last, buddy, 1); in mb_buddy_mark_free()
1805 order++; in mb_buddy_mark_free()
1807 if (first == last || !(buddy2 = mb_find_buddy(e4b, order, &max))) { in mb_buddy_mark_free()
1809 e4b->bd_info->bb_counters[order - 1] += last - first + 1; in mb_buddy_mark_free()
1910 int max, order; in mb_find_extent() local
1927 order = mb_find_order_for_block(e4b, block); in mb_find_extent()
1928 block = block >> order; in mb_find_extent()
1930 ex->fe_len = 1 << order; in mb_find_extent()
1931 ex->fe_start = block << order; in mb_find_extent()
1940 mb_find_buddy(e4b, order, &max)) { in mb_find_extent()
1945 next = (block + 1) * (1 << order); in mb_find_extent()
1949 order = mb_find_order_for_block(e4b, next); in mb_find_extent()
1951 block = next >> order; in mb_find_extent()
1952 ex->fe_len += 1 << order; in mb_find_extent()
1961 block, order, needed, ex->fe_group, ex->fe_start, in mb_find_extent()
4432 int order, i; in ext4_mb_use_preallocated() local
4480 order = fls(ac->ac_o_ex.fe_len) - 1; in ext4_mb_use_preallocated()
4481 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_use_preallocated()
4483 order = PREALLOC_TB_SIZE - 1; in ext4_mb_use_preallocated()
4490 for (i = order; i < PREALLOC_TB_SIZE; i++) { in ext4_mb_use_preallocated()
5360 int order, int total_entries) in ext4_mb_discard_lg_preallocations() argument
5372 list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], in ext4_mb_discard_lg_preallocations()
5445 int order, added = 0, lg_prealloc_count = 1; in ext4_mb_add_n_trim() local
5450 order = fls(pa->pa_free) - 1; in ext4_mb_add_n_trim()
5451 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_add_n_trim()
5453 order = PREALLOC_TB_SIZE - 1; in ext4_mb_add_n_trim()
5456 list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], in ext4_mb_add_n_trim()
5479 &lg->lg_prealloc_list[order]); in ext4_mb_add_n_trim()
5485 order, lg_prealloc_count); in ext4_mb_add_n_trim()