Lines Matching refs:key
135 static void dec_key(struct btree_geo *geo, unsigned long *key) in dec_key() argument
141 val = key[i]; in dec_key()
142 key[i] = val - 1; in dec_key()
159 unsigned long *key) in setkey() argument
161 longcpy(bkey(geo, node, n), key, geo->keylen); in setkey()
208 unsigned long *key) in btree_last() argument
219 longcpy(key, bkey(geo, node, 0), geo->keylen); in btree_last()
225 unsigned long *key) in keycmp() argument
227 return longcmp(bkey(geo, node, pos), key, geo->keylen); in keycmp()
230 static int keyzero(struct btree_geo *geo, unsigned long *key) in keyzero() argument
235 if (key[i]) in keyzero()
242 unsigned long *key) in btree_lookup_node() argument
252 if (keycmp(geo, node, i, key) <= 0) in btree_lookup_node()
264 unsigned long *key) in btree_lookup() argument
269 node = btree_lookup_node(head, geo, key); in btree_lookup()
274 if (keycmp(geo, node, i, key) == 0) in btree_lookup()
281 unsigned long *key, void *val) in btree_update() argument
286 node = btree_lookup_node(head, geo, key); in btree_update()
291 if (keycmp(geo, node, i, key) == 0) { in btree_update()
312 unsigned long *retry_key = NULL, key[MAX_KEYLEN]; in btree_get_prev() local
319 longcpy(key, __key, geo->keylen); in btree_get_prev()
321 dec_key(geo, key); in btree_get_prev()
326 if (keycmp(geo, node, i, key) <= 0) in btree_get_prev()
341 if (keycmp(geo, node, i, key) <= 0) { in btree_get_prev()
351 longcpy(key, retry_key, geo->keylen); in btree_get_prev()
360 unsigned long *key) in getpos() argument
365 if (keycmp(geo, node, i, key) <= 0) in getpos()
385 unsigned long *key, int level) in find_level() argument
392 if (keycmp(geo, node, i, key) <= 0) in find_level()
400 setkey(geo, node, i, key); in find_level()
445 unsigned long *key, void *val, int level, in btree_insert_level() argument
459 node = find_level(head, geo, key, level); in btree_insert_level()
460 pos = getpos(geo, node, key); in btree_insert_level()
463 BUG_ON(pos < fill && keycmp(geo, node, pos, key) == 0); in btree_insert_level()
500 setkey(geo, node, pos, key); in btree_insert_level()
507 unsigned long *key, void *val, gfp_t gfp) in btree_insert() argument
510 return btree_insert_level(head, geo, key, val, 1, gfp); in btree_insert()
515 unsigned long *key, int level);
537 unsigned long *key, int level, unsigned long *child, int fill) in rebalance() argument
547 btree_remove_level(head, geo, key, level + 1); in rebalance()
552 parent = find_level(head, geo, key, level + 1); in rebalance()
553 i = getpos(geo, parent, key); in rebalance()
588 unsigned long *key, int level) in btree_remove_level() argument
601 node = find_level(head, geo, key, level); in btree_remove_level()
602 pos = getpos(geo, node, key); in btree_remove_level()
604 if ((level == 1) && (keycmp(geo, node, pos, key) != 0)) in btree_remove_level()
617 rebalance(head, geo, key, level, node, fill - 1); in btree_remove_level()
626 unsigned long *key) in btree_remove() argument
631 return btree_remove_level(head, geo, key, 1); in btree_remove()
638 unsigned long key[MAX_KEYLEN]; in btree_merge() local
657 if (!btree_last(victim, geo, key)) in btree_merge()
659 val = btree_lookup(victim, geo, key); in btree_merge()
660 err = btree_insert(target, geo, key, val, gfp); in btree_merge()
665 longcpy(dup, key, geo->keylen); in btree_merge()
675 unsigned long *key, size_t index, in __btree_for_each() argument
698 static void empty(void *elem, unsigned long opaque, unsigned long *key, in empty() argument
703 void visitorl(void *elem, unsigned long opaque, unsigned long *key, in visitorl() argument
708 func(elem, opaque, *key, index); in visitorl()
716 u32 *key = (void *)__key; in visitor32() local
718 func(elem, opaque, *key, index); in visitor32()
726 u64 *key = (void *)__key; in visitor64() local
728 func(elem, opaque, *key, index); in visitor64()
736 u64 *key = (void *)__key; in visitor128() local
738 func(elem, opaque, key[0], key[1], index); in visitor128()
745 unsigned long *key, in btree_visitor() argument
763 unsigned long *key, in btree_grim_visitor() argument