Lines Matching refs:bits
118 #define IS_TNODE(n) ((n)->bits)
119 #define IS_LEAF(n) (!(n)->bits)
124 unsigned char bits; /* 2log(KEYLENGTH) bits needed */ member
140 #define tn_bits kv[0].bits
216 return (1ul << tn->bits) & ~(1ul); in child_length()
315 static struct tnode *tnode_alloc(int bits) in tnode_alloc() argument
320 if (bits > TNODE_VMALLOC_MAX) in tnode_alloc()
324 size = TNODE_SIZE(1ul << bits); in tnode_alloc()
361 l->bits = 0; in leaf_new()
371 static struct key_vector *tnode_new(t_key key, int pos, int bits) in tnode_new() argument
373 unsigned int shift = pos + bits; in tnode_new()
378 BUG_ON(!bits || (shift > KEYLENGTH)); in tnode_new()
380 tnode = tnode_alloc(bits); in tnode_new()
385 sizeof(struct key_vector *) << bits); in tnode_new()
387 if (bits == KEYLENGTH) in tnode_new()
390 tnode->empty_children = 1ul << bits; in tnode_new()
395 tn->bits = bits; in tnode_new()
406 return n && ((n->pos + n->bits) == tn->pos) && IS_TNODE(n); in tnode_full()
490 tnode_free_size += TNODE_SIZE(1ul << tn->bits); in tnode_free()
540 tn = tnode_new(oldtnode->key, oldtnode->pos - 1, oldtnode->bits + 1); in inflate()
571 if (inode->bits == 1) { in inflate()
591 node1 = tnode_new(inode->key | m, inode->pos, inode->bits - 1); in inflate()
594 node0 = tnode_new(inode->key, inode->pos, inode->bits - 1); in inflate()
635 tn = tnode_new(oldtnode->key, oldtnode->pos + 1, oldtnode->bits - 1); in halve()
713 slen_max = min_t(unsigned char, tn->pos + tn->bits - 1, tn->slen); in update_suffix()
824 return (used > 1) && (tn->bits > 1) && ((100 * used) < threshold); in should_halve()
834 if ((tn->bits == KEYLENGTH) && tn_info(tn)->full_children) in should_collapse()
959 if (index >= (1ul << n->bits)) { in fib_find_node()
1464 if (index >= (1ul << n->bits)) in fib_table_lookup()
1768 if (cindex >> pn->bits) in leaf_walk_rcu()
1784 if (cindex >= (1ul << pn->bits)) { in leaf_walk_rcu()
1852 cindex = 1ul << n->bits; in fib_trie_free()
1970 cindex = 1ul << n->bits; in fib_table_flush_external()
2041 cindex = 1ul << n->bits; in fib_table_flush()
2119 cindex = 1ul << n->bits; in __fib_info_notify_update()
2517 if (n->bits < MAX_STAT_DEPTH) in trie_collect_stats()
2518 s->nodesizes[n->bits]++; in trie_collect_stats()
2783 &prf, KEYLENGTH - n->pos - n->bits, n->bits, in fib_trie_seq_show()