Lines Matching refs:query
361 hashval_init(thmap_query_t *query, const uint8_t seed[static HASHVAL_SEEDLEN],
366 query->seed = seed;
367 query->rslot = ((hashval >> ROOT_MSBITS) ^ len) & ROOT_MASK;
368 query->level = 0;
369 query->hashval = hashval;
370 query->hashidx = 0;
378 hashval_getslot(thmap_query_t *query, const void * restrict key, size_t len)
380 const unsigned offset = query->level * LEVEL_BITS;
384 if (query->hashidx != i) {
386 query->hashval = hash(query->seed, key, len, i);
387 query->hashidx = i;
389 return (query->hashval >> shift) & LEVEL_MASK;
405 hashval_getl0slot(const thmap_t *thmap, const thmap_query_t *query,
408 if (__predict_true(query->hashidx == 0)) {
409 return query->hashval & LEVEL_MASK;
547 * root_try_put: Try to set a root pointer at query->rslot.
553 root_try_put(thmap_t *thmap, const thmap_query_t *query, thmap_leaf_t *leaf)
556 const unsigned i = query->rslot;
579 slot = hashval_getl0slot(thmap, query, leaf);
603 find_edge_node(const thmap_t *thmap, thmap_query_t *query,
611 ASSERT(query->level == 0);
614 root_slot = atomic_load_consume(&thmap->root[query->rslot]);
620 off = hashval_getslot(query, key, len);
627 query->level++;
651 find_edge_node_locked(const thmap_t *thmap, thmap_query_t *query,
661 node = find_edge_node(thmap, query, key, len, slot);
664 query->level = 0;
674 query->level = 0;
684 query->level = 0;
696 thmap_query_t query;
701 hashval_init(&query, thmap->seed, key, len);
702 parent = find_edge_node(thmap, &query, key, len, &slot);
725 thmap_query_t query;
738 hashval_init(&query, thmap->seed, key, len);
743 switch (root_try_put(thmap, &query, leaf)) {
764 parent = find_edge_node_locked(thmap, &query, key, len, &slot);
804 query.level++;
810 other_slot = hashval_getleafslot(thmap, other, query.level);
832 slot = hashval_getslot(&query, key, len);
855 thmap_query_t query;
861 hashval_init(&query, thmap->seed, key, len);
862 parent = find_edge_node_locked(thmap, &query, key, len, &slot);
882 while (query.level &&
893 query.level--;
894 slot = hashval_getslot(&query, key, len);
929 const unsigned rslot = query.rslot;
933 ASSERT(query.level == 0);