Lines Matching refs:order
440 static void *mb_find_buddy(struct ext4_buddy *e4b, int order, int *max) in mb_find_buddy() argument
447 if (order > e4b->bd_blkbits + 1) { in mb_find_buddy()
453 if (order == 0) { in mb_find_buddy()
458 bb = e4b->bd_buddy + EXT4_SB(e4b->bd_sb)->s_mb_offsets[order]; in mb_find_buddy()
459 *max = EXT4_SB(e4b->bd_sb)->s_mb_maxs[order]; in mb_find_buddy()
557 int order = e4b->bd_blkbits + 1; in __mb_check_buddy() local
577 while (order > 1) { in __mb_check_buddy()
578 buddy = mb_find_buddy(e4b, order, &max); in __mb_check_buddy()
580 buddy2 = mb_find_buddy(e4b, order - 1, &max2); in __mb_check_buddy()
604 for (j = 0; j < (1 << order); j++) { in __mb_check_buddy()
605 k = (i * (1 << order)) + j; in __mb_check_buddy()
611 MB_CHECK_ASSERT(e4b->bd_info->bb_counters[order] == count); in __mb_check_buddy()
612 order--; in __mb_check_buddy()
782 int order = 1; in mb_regenerate_buddy() local
785 while ((buddy = mb_find_buddy(e4b, order++, &count))) { in mb_regenerate_buddy()
1250 int order = 1; in mb_find_order_for_block() local
1258 while (order <= e4b->bd_blkbits + 1) { in mb_find_order_for_block()
1262 return order; in mb_find_order_for_block()
1266 order++; in mb_find_order_for_block()
1354 int order = 1; in mb_buddy_mark_free() local
1355 void *buddy = mb_find_buddy(e4b, order, &max); in mb_buddy_mark_free()
1390 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&first, buddy, -1); in mb_buddy_mark_free()
1392 e4b->bd_info->bb_counters[order] += mb_buddy_adjust_border(&last, buddy, 1); in mb_buddy_mark_free()
1395 order++; in mb_buddy_mark_free()
1397 if (first == last || !(buddy2 = mb_find_buddy(e4b, order, &max))) { in mb_buddy_mark_free()
1399 e4b->bd_info->bb_counters[order - 1] += last - first + 1; in mb_buddy_mark_free()
1496 int max, order; in mb_find_extent() local
1513 order = mb_find_order_for_block(e4b, block); in mb_find_extent()
1514 block = block >> order; in mb_find_extent()
1516 ex->fe_len = 1 << order; in mb_find_extent()
1517 ex->fe_start = block << order; in mb_find_extent()
1526 mb_find_buddy(e4b, order, &max)) { in mb_find_extent()
1531 next = (block + 1) * (1 << order); in mb_find_extent()
1535 order = mb_find_order_for_block(e4b, next); in mb_find_extent()
1537 block = next >> order; in mb_find_extent()
1538 ex->fe_len += 1 << order; in mb_find_extent()
3341 int order, i; in ext4_mb_use_preallocated() local
3390 order = fls(ac->ac_o_ex.fe_len) - 1; in ext4_mb_use_preallocated()
3391 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_use_preallocated()
3393 order = PREALLOC_TB_SIZE - 1; in ext4_mb_use_preallocated()
3400 for (i = order; i < PREALLOC_TB_SIZE; i++) { in ext4_mb_use_preallocated()
4204 int order, int total_entries) in ext4_mb_discard_lg_preallocations() argument
4216 list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], in ext4_mb_discard_lg_preallocations()
4285 int order, added = 0, lg_prealloc_count = 1; in ext4_mb_add_n_trim() local
4290 order = fls(pa->pa_free) - 1; in ext4_mb_add_n_trim()
4291 if (order > PREALLOC_TB_SIZE - 1) in ext4_mb_add_n_trim()
4293 order = PREALLOC_TB_SIZE - 1; in ext4_mb_add_n_trim()
4296 list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], in ext4_mb_add_n_trim()
4318 &lg->lg_prealloc_list[order]); in ext4_mb_add_n_trim()
4324 order, lg_prealloc_count); in ext4_mb_add_n_trim()