Lines Matching refs:order
428 static void *mb_find_buddy(struct ext4_buddy *e4b, int order, int *max) in mb_find_buddy() argument
435 if (order > e4b->bd_blkbits + 1) { in mb_find_buddy()
441 if (order == 0) { in mb_find_buddy()
446 bb = e4b->bd_buddy + EXT4_SB(e4b->bd_sb)->s_mb_offsets[order]; in mb_find_buddy()
447 *max = EXT4_SB(e4b->bd_sb)->s_mb_maxs[order]; in mb_find_buddy()
547 int order = e4b->bd_blkbits + 1; in __mb_check_buddy() local
567 while (order > 1) { in __mb_check_buddy()
568 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
570 buddy2 = mb_find_buddy(e4b, order - 1, &max2); in __mb_check_buddy()
594 for (j = 0; j < (1 << order); j++) { in __mb_check_buddy()
595 k = (i * (1 << order)) + j; in __mb_check_buddy()
601 MB_CHECK_ASSERT(e4b->bd_info->bb_counters[order] == count); in __mb_check_buddy()
602 order--; in __mb_check_buddy()
770 int order = 1; in mb_regenerate_buddy() local
773 while ((buddy = mb_find_buddy(e4b, order++, &count))) { in mb_regenerate_buddy()
1255 int order = 1; in mb_find_order_for_block() local
1263 while (order <= e4b->bd_blkbits + 1) { in mb_find_order_for_block()
1267 return order; in mb_find_order_for_block()
1271 order++; in mb_find_order_for_block()
1359 int order = 1; in mb_buddy_mark_free() local
1360 void *buddy = mb_find_buddy(e4b, order, &max); in mb_buddy_mark_free()
1395 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&first, buddy, -1); in mb_buddy_mark_free()
1397 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&last, buddy, 1); in mb_buddy_mark_free()
1400 order++; in mb_buddy_mark_free()
1402 if (first == last || !(buddy2 = mb_find_buddy(e4b, order, &max))) { in mb_buddy_mark_free()
1404 e4b->bd_info->bb_counters[order - 1] += last - first + 1; in mb_buddy_mark_free()
1497 int max, order; in mb_find_extent() local
1514 order = mb_find_order_for_block(e4b, block); in mb_find_extent()
1515 block = block >> order; in mb_find_extent()
1517 ex->fe_len = 1 << order; in mb_find_extent()
1518 ex->fe_start = block << order; in mb_find_extent()
1527 mb_find_buddy(e4b, order, &max)) { in mb_find_extent()
1532 next = (block + 1) * (1 << order); in mb_find_extent()
1536 order = mb_find_order_for_block(e4b, next); in mb_find_extent()
1538 block = next >> order; in mb_find_extent()
1539 ex->fe_len += 1 << order; in mb_find_extent()
1547 block, order, needed, ex->fe_group, ex->fe_start, in mb_find_extent()
3404 int order, i; in ext4_mb_use_preallocated() local
3453 order = fls(ac->ac_o_ex.fe_len) - 1; in ext4_mb_use_preallocated()
3454 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_use_preallocated()
3456 order = PREALLOC_TB_SIZE - 1; in ext4_mb_use_preallocated()
3463 for (i = order; i < PREALLOC_TB_SIZE; i++) { in ext4_mb_use_preallocated()
4270 int order, int total_entries) in ext4_mb_discard_lg_preallocations() argument
4282 list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], in ext4_mb_discard_lg_preallocations()
4354 int order, added = 0, lg_prealloc_count = 1; in ext4_mb_add_n_trim() local
4359 order = fls(pa->pa_free) - 1; in ext4_mb_add_n_trim()
4360 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_add_n_trim()
4362 order = PREALLOC_TB_SIZE - 1; in ext4_mb_add_n_trim()
4365 list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], in ext4_mb_add_n_trim()
4387 &lg->lg_prealloc_list[order]); in ext4_mb_add_n_trim()
4393 order, lg_prealloc_count); in ext4_mb_add_n_trim()