Lines Matching full:sorted
232 darray_resize(&wb->sorted, wb->flushing.keys.size); in move_keys_from_inc_to_flushing()
234 if (!wb->flushing.keys.nr && wb->sorted.size >= wb->inc.keys.nr) { in move_keys_from_inc_to_flushing()
240 wb->sorted.size - wb->flushing.keys.nr); in move_keys_from_inc_to_flushing()
266 BUG_ON(wb->sorted.size < wb->flushing.keys.nr); in move_keys_from_inc_to_flushing()
292 wb->sorted.data[i].idx = i; in bch2_btree_write_buffer_flush_locked()
293 wb->sorted.data[i].btree = wb->flushing.keys.data[i].btree; in bch2_btree_write_buffer_flush_locked()
294 memcpy(&wb->sorted.data[i].pos, &wb->flushing.keys.data[i].k.k.p, sizeof(struct bpos)); in bch2_btree_write_buffer_flush_locked()
296 wb->sorted.nr = wb->flushing.keys.nr; in bch2_btree_write_buffer_flush_locked()
300 * then we attempt to flush in sorted btree order, as this is most in bch2_btree_write_buffer_flush_locked()
312 wb_sort(wb->sorted.data, wb->sorted.nr); in bch2_btree_write_buffer_flush_locked()
314 darray_for_each(wb->sorted, i) { in bch2_btree_write_buffer_flush_locked()
317 for (struct wb_key_ref *n = i + 1; n < min(i + 4, &darray_top(wb->sorted)); n++) in bch2_btree_write_buffer_flush_locked()
328 if (i + 1 < &darray_top(wb->sorted) && in bch2_btree_write_buffer_flush_locked()
669 ret = darray_resize(&wb->sorted, wb->flushing.keys.size); in bch2_journal_key_to_wb_slowpath()
685 dst->room = min(dst->room, wb->sorted.size - wb->flushing.keys.nr); in bch2_journal_key_to_wb_slowpath()
724 dst->room = min(dst->room, wb->sorted.size - wb->flushing.keys.nr); in bch2_journal_keys_to_write_buffer_start()
828 darray_exit(&wb->sorted); in bch2_fs_btree_write_buffer_exit()
846 darray_make_room(&wb->sorted, initial_size); in bch2_fs_btree_write_buffer_init()