Lines Matching refs:n1
1409 struct bset *n1 = btree_bset_first(new_nodes[i]); in btree_gc_coalesce() local
1419 if (__set_blocks(n1, n1->keys + keys + in btree_gc_coalesce()
1436 if (__set_blocks(n1, n1->keys + n2->keys, in btree_gc_coalesce()
1446 BUG_ON(__set_blocks(n1, n1->keys + keys, block_bytes(b->c->cache)) > in btree_gc_coalesce()
1452 memcpy(bset_bkey_last(n1), in btree_gc_coalesce()
1456 n1->keys += keys; in btree_gc_coalesce()
1457 r[i].keys = n1->keys; in btree_gc_coalesce()
2255 struct btree *n1, *n2 = NULL, *n3 = NULL; in btree_split() local
2270 n1 = btree_node_alloc_replacement(b, op); in btree_split()
2271 if (IS_ERR(n1)) in btree_split()
2274 split = set_blocks(btree_bset_first(n1), in btree_split()
2275 block_bytes(n1->c->cache)) > (btree_blocks(b) * 4) / 5; in btree_split()
2280 trace_bcache_btree_node_split(b, btree_bset_first(n1)->keys); in btree_split()
2292 mutex_lock(&n1->write_lock); in btree_split()
2295 bch_btree_insert_keys(n1, op, insert_keys, replace_key); in btree_split()
2302 while (keys < (btree_bset_first(n1)->keys * 3) / 5) in btree_split()
2303 keys += bkey_u64s(bset_bkey_idx(btree_bset_first(n1), in btree_split()
2306 bkey_copy_key(&n1->key, in btree_split()
2307 bset_bkey_idx(btree_bset_first(n1), keys)); in btree_split()
2308 keys += bkey_u64s(bset_bkey_idx(btree_bset_first(n1), keys)); in btree_split()
2310 btree_bset_first(n2)->keys = btree_bset_first(n1)->keys - keys; in btree_split()
2311 btree_bset_first(n1)->keys = keys; in btree_split()
2314 bset_bkey_last(btree_bset_first(n1)), in btree_split()
2324 trace_bcache_btree_node_compact(b, btree_bset_first(n1)->keys); in btree_split()
2326 mutex_lock(&n1->write_lock); in btree_split()
2327 bch_btree_insert_keys(n1, op, insert_keys, replace_key); in btree_split()
2330 bch_keylist_add(&parent_keys, &n1->key); in btree_split()
2331 bch_btree_node_write(n1, &cl); in btree_split()
2332 mutex_unlock(&n1->write_lock); in btree_split()
2348 bch_btree_set_root(n1); in btree_split()
2360 rw_unlock(true, n1); in btree_split()
2370 bkey_put(b->c, &n1->key); in btree_split()
2371 btree_node_free(n1); in btree_split()
2372 rw_unlock(true, n1); in btree_split()
2378 n1 == ERR_PTR(-EAGAIN)) in btree_split()